Question: Consider the following line of code: int x[] = new int[25];
 


Question: Consider the following line of code:

int x[] = new int[25];

After execution, which statement or statements are true?

A. x[24] is 0.

B. x[24] is undefined.

C. x[25] is 0.

D. x[0] is null.

E. x.length is 25.

Answer:A and E are true. The array has 25 elements, indexed from 0 through 24. All elements are initialized to zero.

 

 

 

 

 
 
 
 
 
COPYRIGHT © 2017 java-samples.com. ALL RIGHTS RESERVED.