Q. What is the output of Java code snippet?
Code:
int[] ary = {5,6,7,8};
if(ary.length > 2)
{
System.out.println(ary[2]);
}
β
Correct Answer: (B)
7
int[] ary = {5,6,7,8};
if(ary.length > 2)
{
System.out.println(ary[2]);
}
You must be Logged in to update hint/solution