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 Structures42 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 Io40 Questions
Exam 11: Java-Fx: Gui Programming and Basic Controls40 Questions
Exam 12: Java-Fx: Advanced Controls40 Questions
Exam 13: Java-Fx: Graphics, Effects, and Media40 Questions
Exam 14: Recursion24 Questions
Exam 15: Databases40 Questions
Select questions type
For the following code, what would be the value of str[2]?
String[ ] str = {"abc", "def", "ghi", "jkl"};
Free
(Multiple Choice)
4.7/5
(37)
Correct Answer:
A
What would be the result of executing the following code?
int[ ] x = {0, 1, 2, 3, 4, 5};
Free
(Multiple Choice)
4.8/5
(37)
Correct Answer:
B
A sorting algorithm is a technique for scanning through an array and rearranging its contents in some specific order.
(True/False)
4.7/5
(37)
When an array of objects is declared but not initialized, the array values are set to 0.
(True/False)
4.8/5
(32)
A(n) __________ is used as an index to pinpoint a specific element within an array.
(Multiple Choice)
4.7/5
(43)
The String[ ] args parameter in the main method header allows the program to receive arguments from the operating system command-line.
(True/False)
4.8/5
(38)
Which of the following ArrayList class methods is used to insert an item at a specific location in an ArrayList?
(Multiple Choice)
4.9/5
(40)
What will be the result after the following code is executed?
final int ARRAY_SIZE = 5;
Float[ ] x = float[ARRAY_SIZE];
For (i = 1; i <= ARRAY_SIZE; i++)
{
X[i] = 10.0;
}
(Multiple Choice)
4.8/5
(40)
An ArrayList object automatically expands in size to accommodate the items stored in it.
(True/False)
4.7/5
(34)
Which of the following import statements is required in order to use the ArrayList class?
(Multiple Choice)
4.9/5
(38)
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.9/5
(38)
To determine if two arrays are equal you must compare each of the elements of the two arrays.
(True/False)
4.8/5
(38)
The __________ method removes an item from an ArrayList at a specific index.
(Multiple Choice)
4.8/5
(30)
Java provides a mechanism known as a __________ which makes it possible to write a method that takes a variable number of arguments.
(Multiple Choice)
4.8/5
(39)
Objects in an array are accessed with subscripts, just like any other data type in an array.
(True/False)
4.9/5
(44)
What does the following statement do?
double[ ] array1 = new double[10];
(Multiple Choice)
4.8/5
(27)
Showing 1 - 20 of 40
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)