Given:
What is the result?
A. 91 98
99 100 null null null
B. 91 98
99100 101 102 103
C. Compilation rails.
D. A NullPointerException is thrown at runtime.
E. An ArraylndexOutOfBoundsException is thrown at runtime.
Given:
What is the result?
A. 91 98
99 100 null null null
B. 91 98
99100 101 102 103
C. Compilation rails.
D. A NullPointerException is thrown at runtime.
E. An ArraylndexOutOfBoundsException is thrown at runtime.
public static void main(String[] args) {
String [] [] chs = new String[2][];
chs[0] = new String[2];
chs[1] = new String[5];
int i = 97;//from this line we give the array element values
for(int a =0; a<chs.length; a++){
for(int b=0 ; b<chs.length;b++){
chs[a][b] = "" +i;
i++;
}
}
for (String[] ca : chs){ //print every element
for (String s :ca){
System.out.print(s+" ");
}
System.out.println();
}
}
Answer A:
With a note of the typo error in the answer, it is 97 not 91.
A
(97 98
99 100 null null null)