Analyze the following code:
```
public class Test {
public static void main(String[] args) {
boolean[][] x = new boolean[3][];
x[0] = new boolean[1]; x[1] = new boolean[2];
x[2] = new boolean[3];
System.out.println("x[2][2] is " + x[2][2]);
}
}```
a. The program has a compile error because new boolean[3][] is wrong.
b. The program has a runtime error because x[2][2] is null.
c. The program runs and displays x[2][2] is null.
d. The program runs and displays x[2][2] is true.
e. The program runs and displays x[2][2] is false.
e x is a ragged array. (See the section on Ragged Array) x[2] has three elements with default value false.
You might also like to view...
In C++, a variable that has been defined but not initialized may
a) be used in any way any identifier can be used. b) not be used at all c) not be used as an l-value d) not be used as an r-value e) have its value fetched prior to assignment.
An import declaration is not required if you always refer to a class with its ________ name, which includes its package name and class name.
a. compile-time b. default package c. paired d. fully qualified name
In Java, polymorphic references can be created through the use of __________________ and ________________.
a) inheritance, interfaces b) inheritance, abstract classes c) interfaces, abstract classes d) interfaces, iterators e) none of the above
________ is a process to eliminate repeating groups found in variable-length records.
A) Alpha row selection B) First row selection C) Normalization D) Denormalization