0
What is array and how it is use?
array
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"