0

What is array and how it is use?

array

3rd Jan 2018, 9:43 AM
yash budhe
yash budhe - avatar
2 Answers
+ 4
String yash[] = { "is" , "learning" , "java" }; just think of it as storing multiple values/elements to a variable. you call your first element using yash[0] as java counts from 0 to 1 so yash[0] selects the element "is" from the array yash[1] gives you "learning" yash[2] gives you "java" put any of these into the println method and it will print to the screen ie System.out.println(yash[2]); //output "java"
3rd Jan 2018, 11:43 AM
D_Stark
D_Stark - avatar