Exam 7: Arrays and Array Lists
Exam 1: Introduction76 Questions
Exam 2: Using Objects82 Questions
Exam 3: Implementing Classes108 Questions
Exam 4: Fundamental Data Types124 Questions
Exam 5: Decisions119 Questions
Exam 6: Loops107 Questions
Exam 7: Arrays and Array Lists117 Questions
Exam 8: Designing Classes88 Questions
Exam 9: Inheritance99 Questions
Exam 10: Interfaces100 Questions
Exam 11: Input/Output and Exception Handling108 Questions
Exam 12: Object-Oriented Design104 Questions
Exam 13: Recursion99 Questions
Exam 14: Sorting and Searching100 Questions
Exam 15: The Java Collections Framework102 Questions
Exam 16: Basic Data Structures102 Questions
Exam 17: Tree Structures102 Questions
Exam 18: Generic Classes75 Questions
Exam 19: Stream Processing85 Questions
Exam 20: Graphical User Interfaces75 Questions
Exam 21: Advanced Input/Output90 Questions
Exam 22: Multithreading81 Questions
Exam 23: Internet Networking74 Questions
Exam 24: Relational Databases75 Questions
Exam 25: XML74 Questions
Select questions type
Assume the following variable has been declared and given a value as shown:
Which is the value of data.length?

Free
(Multiple Choice)
4.9/5
(37)
Correct Answer:
B
Which one of the following statements is a valid initialization of an array named somearray of ten elements?
Free
(Multiple Choice)
4.8/5
(32)
Correct Answer:
A
Consider the following code snippet:
int val = arr[0][2];
Which value of arr is stored in the val variable?
Free
(Multiple Choice)
4.9/5
(34)
Correct Answer:
C
Which statements about array algorithms are true?
I.The array algorithms are building blocks for many programs that process arrays.
II.Java contains ready-made array algorithms for every problem situation.
III.It is inefficient to make multiple passes through an array if you can do everything in one pass.
(Multiple Choice)
4.9/5
(43)
Which one of the following is the correct code snippet for calculating the largest value in an integer array list aList?
(Multiple Choice)
4.8/5
(44)
When an integer literal is added to an array list declared as ArrayList<Integer>, Java performs:
(Multiple Choice)
4.7/5
(32)
What is the value of the count variable after the execution of the given code snippet?

(Multiple Choice)
4.8/5
(32)
Which one of the following statements is correct for displaying the value in the second row and the third column of a two-dimensional, size 3 by 4 array?
(Multiple Choice)
4.7/5
(34)
Consider the following code snippet:
Which one of the following is true about the check method in the given code snippet?

(Multiple Choice)
4.9/5
(39)
Consider using a deck of cards as a way to visualize a shuffle algorithm.When two cards shuffle their position, what has to happen to the size of the array holding them?
(Multiple Choice)
4.8/5
(38)
Which statements about the enhanced for loop are true for arrays of primitive data?
I.It is suitable for all array algorithms.
II.It does not allow the contents of the array to be modified.
III.It does not require the use of an index variable.
(Multiple Choice)
4.8/5
(34)
Which one of the following is a correct declaration for a method named passAList with the array list num of size 5 as a parameter?
(Multiple Choice)
4.7/5
(29)
Which statements are true regarding the differences between arrays and array lists?
I. Arrays are better if the size of a collection will not change.
II. Array lists are more efficient than arrays.
III. Array lists are easier to use than arrays.
(Multiple Choice)
4.9/5
(36)
How many elements can be stored in an array of dimension 2 by 3?
(Multiple Choice)
4.9/5
(46)
It may be necessary to "grow" an array when reading inputs because
(Multiple Choice)
5.0/5
(34)
Consider the following code snippet:
What is the output of the given code snippet if the user enters 1,2,0,0,1 as the input?

(Multiple Choice)
4.8/5
(34)
Showing 1 - 20 of 117
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)