Multiple choice technology programming languages

Consider the following line of code: int x[] == new int[25]; After execution, which statement or statements are true?

  1. x[24] is 0

  2. x[24] is undefined

  3. x[25] is 0

  4. x[0] is null

  5. x.length is 25

Reveal answer Fill a bubble to check yourself
A,E Correct answer
Explanation

When an int array is created in Java, all elements are automatically initialized to 0 by default. A 25-element array has valid indices from 0 to 24, so x[24] is the last element and contains 0. The array's length is 25, accessible via x.length. Option C is wrong because x[25] is out of bounds, option D is wrong because int arrays cannot contain null (they contain primitive int values), and option B is wrong because array elements are initialized, not undefined.