Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. After you create an array variable, you still need to ____ memory space. a. c

ID: 3767353 • Letter: 1

Question

1. After you create an array variable, you still need to ____ memory space. a. create c. reserve b. organize d. dump

2. When you initialize parallel arrays, it is convenient to use ____ so that the values that correspond to each other visually align on the screen or printed page. a. tabs c. spacing b. indentation d. dashes

3. Which of the following println statements will display the last myScores element in an array of 10? a. System.out.println(vals[0]); c. System.out.println(vals[9]); b. System.out.println(vals[1]); d. System.out.println(vals[10]);

4. To declare a two-dimensional array in Java, you type two sets of ____ after the array type. a. { } c. ( ) b. [ ] d. < >

5. The Arrays class ____ method searches the specified array for the specified key value using the binary search algorithm. a. binarySearch c. equals b. sort d. search

6. You can add an item at any point in a(n) ____ container and the array size expands automatically to accommodate the new item. a. ArrayList c. ResizableArray b. Array d. array

7. An ArrayList’s ____ is the number of items it can hold without having to increase its size. a. length c. capacity b. buffer d. size ____ 8. int[][] myVals = {{2, 4, 6}, {1, 3, 5, 7}}; Using the above array, what is the value of myVals.length? a. 1 c. 4 b. 2 d. 5

9. If a programming language does not support ____, the language is not considered objectoriented. a. syntax c. loops b. applets d. polymorphism

10. When you create a class and do not provide a(n) ____, Java automatically supplies you with a default one. a. constructor c. header b. argument d. name

Explanation / Answer

1.you create an array variable, you still need to _reseve___ memory space

2. When you initialize parallel arrays, it is convenient to use _spacing___ so that the values that correspond to each other visually align on the screen or printed page.

3. Which of the following println statements will display the last myScores element in an array of 10?-- c. System.out.println(vals[9]).

4.To declare a two-dimensional array in Java, you type two sets of b. [ ] after the array type.--b. [ ]

5.a.binary search:

The java.util.Arrays.binarySearch(int[] a, int key) method searches the specified array of ints for the specified value using the binary search algorithm.The array must be sorted before making this call.If it is not sorted, the results are undefined.

6.6. You can add an item at any point in a(n) __a. ArrayList__ container and the array size expands automatically to accommodate the new item.

7. An ArrayList’s _c. capacity ___ is the number of items it can hold without having to increase its size

8. int[][] myVals = {{2, 4, 6}, {1, 3, 5, 7}}; Using the above array, what is the value of myVals.length?----c.4(it may be rise error it has 1st array has 3 values and 2nd has 4 values).

9. If a programming language does not support _d. polymorphism___, the language is not considered objectoriented. a. syntax c. loops b. applets d. polymorphism.(the two features applets ,polymorphism of does't supported by any other languages other then oop languages).

10. When you create a class and do not provide a(n) a. constructor ____, Java automatically supplies you with a default one.-----A default (no-argument) constructor is automatically created only when you do not define any constructor yourself.

Thank you!

please share commnet