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

Veröffentlicht am: 08 August 2015
auf dem Kanal: 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};


Auf dieser Seite können Sie das Online-Video Java for Beginners 7 : Array and Initializer syntax (Gangster style??) mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer shawnkoon 08 August 2015 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 307 Mal angesehen und es wurde von 8 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!