What would happen on compiling and running the following code?
public class Anchor
{
public static void main(String[] argv)
{
new Anchor();
}
public Anchor()
{
String s[][] = new String[2][2];
System.out.println(s[1][1]);
System.out.println(s[1][2]);
}
}
Correct Answer: Compiles and prints null followed by ArrayIndexOutOfBoundsException
Explanation:
Note: This Question is unanswered, help us to find answer for this one
More Java MCQ Questions