Hi, can someone explain what is going on in the below question?
1. class Ex1{
2. public static void main(String[] args) {
3. int a[] = { 1,2,053,4};
4. int b[][] = { {1,2,4} , {2,2,1},{0,43,2}};
5. System.out.print(a[3]==b[0][2] );
6. System.out.print(" " + (a[2]==b[2][1]));
7. }
8. }
Which is the result?
A. true false
B. false false
C. false true
D. true true
E. Compilation fails
Answer is D, why is the second true?
1. class Ex1{
2. public static void main(String[] args) {
3. int a[] = { 1,2,053,4};
4. int b[][] = { {1,2,4} , {2,2,1},{0,43,2}};
5. System.out.print(a[3]==b[0][2] );
6. System.out.print(" " + (a[2]==b[2][1]));
7. }
8. }
Which is the result?
A. true false
B. false false
C. false true
D. true true
E. Compilation fails
Answer is D, why is the second true?