Question 5
class MWC105 {
static boolean b1;
public static void main(
String[] args) {
boolean[] array = new boolean[1];
boolean b2;
System.out.print(b1+",");
System.out.print(array[0]+",");
System.out.print(b2);
}}
What is the result of attempting to compile and run the program?
a. Prints: true,true,true
b. Prints: false,false,false
c. Prints: null,null,null
d. Prints: false,true,false
e. Compile-time error
f. Run-time error
g. None of the above
The answer should be (f) but it is given as (e) ?