-
What is the output of this program?
public class Result
{
public static void main(String[] args)
{
int []p[] = {{1,2}, {3,4,5}, {6,7,8,9}};
int [][]q = p;
System.out.println("Alligator");
System.out.println(q[0][0]);
}
}
-
- Alligator
1 - Alligator
2 - Alligator
3 - Alligator
4 - Alligator
5
- Alligator
Correct Option: A
Both p,and q are pointing to the same array.