104k views
3 votes
Identify the false statement.

a. The first element in any array has a subscript of 0, no matter what data type is stored.
b. In Java, you can use a variable as well as a constant to declare an array's size.
c. The statement int[] idNums = new int[35]; reserves enough memory for exactly 34 integers.

1 Answer

3 votes

Final answer:

The false statement is c. The statement int[] idNums = new int[35]; reserves enough memory for exactly 34 integers. In reality, the correct statement is that it reserves enough memory for exactly 35 integers.

Step-by-step explanation:

The false statement is c. The statement int[] idNums = new int[35]; reserves enough memory for exactly 34 integers.

In this statement, the array size is declared as 35, which means there is enough memory reserved for 35 integers, not 34.

The correct statement should be: The statement int[] idNums = new int[35]; reserves enough memory for exactly 35 integers.

User Neelaganda Moorthy
by
7.2k points