Java for Beginners 7 : Array and Initializer syntax (Gangster style??)

Pubblicato il: 08 agosto 2015
sul canale di: shawnkoon
307
8

Hello guys! this shawn koon here, I hope you enjoyed this video..!
If you guys liked my videos, please subscribe for more future videos :) Thank you
So, I might do password brute force hacking algorithm tutorial soon, so stay tuned!!!

Alright guys, today i talked about how to create an array and how to set value into array and how to use array initializer syntax!! here are more details!

Hello Programmers! This is shawnkoon here for another Java tutorial. Today, we are going to learn something about Array in Java. What is an Array? easy way of explaining array would be something like, train with variables so there are lot of boxes on the train right?? think of elements as a box on the train and think of ppl or things inside as a variable. So, it's basically collection of variable unlike some of the other programming language, Java tends to be stricked about giving types to Array. Which means, you have to have type of array and variables in it to match in order to create an array.



1. Initializing Array (Traditional way).
int[] ara = new int[5];
int count = 0;

while (count ( 5)
{
ara[count] = 5 - count;
count++;
}
// There is an easier way with for loop but for later tutorial
System.out.println(ara[0]);
System.out.println(ara[1]);
System.out.println(ara[2]);
System.out.println(ara[3]);
System.out.println(ara[4]);

2. Array Initializer Syntax.
int[] newAra = {5,4,3,2,1};


In questa pagina del sito puoi guardare il video online Java for Beginners 7 : Array and Initializer syntax (Gangster style??) della durata di ore minuti seconda in buona qualità , che l'utente ha caricato shawnkoon 08 agosto 2015, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 307 volte e gli è piaciuto 8 spettatori. Buona visione!