Solved

What Is the Printout for the Following Code? Class Test

Question 1

Multiple Choice

What is the printout for the following code? class Test {
Public static void main(String[] args) {
Int[] x = new int[3];
System.out.println("x[0] is "+x[0]) ;
}
}


A) The program has a syntax error because the size of the array wasn't specified when declaring the array.
B) The program has a runtime error because the array elements are not initialized.
C) The program runs fine and displays x[0] is 0.
D) None of the above.

Correct Answer:

verifed

Verified

Related Questions