Exam 7: Arrays and the ArrayList Class
Exam 1: Introduction to Computers and Java40 Questions
Exam 2: Java Fundamentals40 Questions
Exam 3: A First Look at Classes and Objects40 Questions
Exam 4: Decision Structures40 Questions
Exam 5: Loops and Files40 Questions
Exam 6: A Second Look at Classes and Objects40 Questions
Exam 7: Arrays and the ArrayList Class40 Questions
Exam 8: Text Processing and Wrapper Classes40 Questions
Exam 9: Inheritance40 Questions
Exam 10: Exceptions and Advanced File I/O40 Questions
Exam 11: GUI Applications–Part 140 Questions
Exam 12: GUI Applications–Part 240 Questions
Exam 13: Applets and More40 Questions
Exam 14: Creating GUI Applications with JavaFX40 Questions
Exam 15: Recursion20 Questions
Exam 16: Databases40 Questions
Select questions type
What does the following statement do?
Double[] array1 = new double[10];
Free
(Multiple Choice)
4.9/5
(45)
Correct Answer:
D
The following import statement is required to use the ArrayList class:
Free
(Multiple Choice)
4.9/5
(32)
Correct Answer:
B
What will be the result of executing the following code?
Int[] x = {0, 1, 2, 3, 4, 5};
(Multiple Choice)
4.9/5
(38)
Objects in an array are accessed with subscripts, just like any other data type in an array.
(True/False)
4.8/5
(36)
If numbers is a two-dimensional array, which of the following would give the number of columns in row r?
(Multiple Choice)
4.8/5
(39)
You can use this ArrayList class method to insert an item at a specific location in an ArrayList.
(Multiple Choice)
4.9/5
(36)
A sorting algorithm is a technique for scanning through an array and rearranging its contents in some specific order.
(True/False)
4.8/5
(30)
Which of the following is a valid declaration for a ragged array with five rows, but no columns?
(Multiple Choice)
4.7/5
(42)
To determine if two arrays are equal, you must compare each of the elements of the two arrays.
(True/False)
4.9/5
(44)
You can use the ________ method to replace an item at a specific location in an ArrayList.
(Multiple Choice)
4.9/5
(45)
Any items typed on the command-line, separated by space, after the name of the class are considered to be one or more arguments that are to be passed into the main method.
(True/False)
4.7/5
(31)
What will be the result of the following code?
Final int ARRAY_SIZE = 5;
Float[] x = float[ARRAY_SIZE];
For(int i = 1; i <= ARRAY_SIZE; i++)
{
X[i] = 10.0;
}
(Multiple Choice)
4.7/5
(40)
The ________ method removes an item from an ArrayList at a specific index.
(Multiple Choice)
4.7/5
(37)
A sorting algorithm is used to locate a specific item in a larger collection of data.
(True/False)
4.7/5
(35)
An ArrayList object automatically expands in size to accommodate the items stored in it.
(True/False)
4.7/5
(37)
What is the value of scores[2][3] in the following array?
Int[][] scores = { {88, 80, 79, 92},
{75, 84, 93, 80},
{98, 95, 92, 94},
{91, 84, 88, 96} };
(Multiple Choice)
4.8/5
(39)
Showing 1 - 20 of 40
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)