posted 24 years ago
What will happen if run the following code?
1:Boolean[] b1 = new Boolean[10];
2:
3:boolean[] b2 = new boolean[10];
4:
6:System.out.println("The value of b1[1] = " +b1[1]);
7:System.out.println("The value of b2[1] = " +b2[1]);
A) Prints "The value of b1[1] = false"
"The value of b2[1] = false".
B) Prints "The value of b1[1] = null"
"The value of b2[1] = null".
C) Prints "The value of b1[1] = null"
"The value of b2[1] = false".
D) Prints "The value of b1[1] = false"
"The value of b2[1] = null".
I think the answer should be B. Coorect me if i am wrong.