Question: 6 quick java questions. Thanks to whomever helps me! 1. Identify the false statement. a. The statement int[] idNums = new int[35]; reserves enough memory

6 quick java questions. Thanks to whomever helps me!

1. Identify the false statement.

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

2. Identify the false statement.

a. When you declare int[] scores = {100, 90, 80};, the first three elements of the array are assigned the values listed, but all the remaining elements are assigned 0.
b. When you declare int[] idNums = new int[35];, each element of the array has a value of 0.
c. When you declare double[] salaries = new double[10];, each element of the array has a value of 0.0.

3. Identify the false statement.

a. When an application contains an array, it is common to perform loops that vary the loop control variable from 0 to one less than the size of the array.
b. An array's length field contains the highest value that can be used as the array's subscript.
c. The enhanced for loop allows you to cycle through an array without specifying the starting and ending points for the loop control variable.

4. Identify the false statement.

a. To use a method that belongs to an object that is part of an array, you insert the appropriate subscript notation after the array name and before the dot that precedes the method name.
b. The following statement declares an array named students that holds 10 Student objects: Student[] students = new Student[10];
c. When a class has a default constructor and you create an array of objects from the class, you do not need to call the constructor explicitly.

5. Identify the false statement.

a. A parallel array is one with the same number of elements as another and for which the values in corresponding elements are related.
b. When searching an array, it is usually most efficient to abandon the search as soon as the sought-after element is found.
c. In a range match, you commonly compare a value to the midpoint of each of a series of numerical ranges.

6. Identify the false statement.

a. When a method returns an array reference, you include square brackets with the return type in the method header.
b. You pass a single array element to a method using its name, and the method must be prepared to receive the appropriate data type.
c. You pass an array to a method using its name followed by a pair of brackets; arrays are passed by value.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!