Exam 7: Arrays and the Arraylist Class
Exam 1: Introduction to Computers and Java53 Questions
Exam 2: Java Fundamentals52 Questions
Exam 3: Decision Structures58 Questions
Exam 4: Loops and Files56 Questions
Exam 5: Methods56 Questions
Exam 6: A First Look at Classes58 Questions
Exam 7: Arrays and the Arraylist Class63 Questions
Exam 8: A Second Look at Classes and Objects52 Questions
Exam 9: Text Processing and More About Wrapper Classes62 Questions
Exam 10: Inheritance64 Questions
Exam 11: Exceptions and Advanced File Io59 Questions
Exam 12: Java-Fx: Gui Programming and Basic Controls42 Questions
Exam 13: Java-Fx: Advanced Controls40 Questions
Exam 14: Java-Fx: Graphics, Effects, and Media40 Questions
Exam 15: Recursion23 Questions
Exam 16: Databases40 Questions
Select questions type
If numbers is a two-dimensional array, which of the following would give the number of columns in row r?
Free
(Multiple Choice)
4.9/5
(45)
Correct Answer:
C
Once an array is created, its size cannot be changed.
Free
(True/False)
4.9/5
(39)
Correct Answer:
True
Java performs ____________, which means that it does not allow a statement to use a subscript that is outside the range of valid subscripts for the array.
Free
(Multiple Choice)
4.9/5
(36)
Correct Answer:
B
It is common practice to use a __________ variable as a size declarator.
(Multiple Choice)
4.8/5
(44)
To return an array of long values from a method, which return type should be used for the method?
(Multiple Choice)
4.7/5
(35)
What would be the result after the following code is executed?
final int SIZE = 25;
Int[ ] array1 = new int[SIZE];
).. // Code that will put values in array1
Int value = 0;
For (int a = 0; a <= array1.length; a++)
{
Value += array1[a];
}
(Multiple Choice)
4.7/5
(38)
What does the following statement do? double[ ] array1 = new double[10];
(Multiple Choice)
5.0/5
(43)
Objects in an array are accessed with subscripts, just like any other data type in an array.
(True/False)
4.8/5
(32)
Which of the following is a correct method header for receiving a two-dimensional array as an argument?
(Multiple Choice)
4.9/5
(27)
Any items typed on the command line, separated by a 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.8/5
(39)
Java limits the number of dimensions that an array can have to 15.
(True/False)
4.9/5
(39)
Which of the following is a correct method header for receiving a two-dimensional array as an argument?
(Multiple Choice)
4.8/5
(31)
The ___________ method is used to insert an item into an ArrayList.
(Multiple Choice)
4.9/5
(37)
You can use the __________ method to replace an item at a specific location in an ArrayList.
(Multiple Choice)
4.8/5
(35)
What will be the value of x[8] after the following code is executed?
final int SUB = 12;
Int[ ] x = new int[SUB];
Int y = 20;
For(int i = 0; i < SUB; i++)
{
X[i] = y;
Y += 5;
}
(Multiple Choice)
4.9/5
(38)
If final int SIZE = 15 and int[ ] x = new int[SIZE], what would be the range of subscript values that could be used with x[ ]?
(Multiple Choice)
4.9/5
(40)
A(n) __________ is used as an index to pinpoint a specific element within an array.
(Multiple Choice)
4.7/5
(39)
Which of the following is a valid declaration for a ragged array with five rows but no columns?
(Multiple Choice)
4.9/5
(29)
For the following code, what would be the value of str[2]?
String[ ] str = {"abc", "def", "ghi", "jkl"};
(Multiple Choice)
4.9/5
(36)
Showing 1 - 20 of 63
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)