Exam 7: Arrays and the Arraylist Class
Exam 1: Introduction to Computers and Java51 Questions
Exam 2: Java Fundamentals61 Questions
Exam 3: Decision Structures64 Questions
Exam 4: Loops and Files57 Questions
Exam 5: Methods60 Questions
Exam 6: A First Look at Classes58 Questions
Exam 7: Arrays and the Arraylist Class64 Questions
Exam 8: A Second Look at Classes and Objects50 Questions
Exam 9: Text Processing and More About Wrapper Classes60 Questions
Exam 10: Inheritance70 Questions
Exam 11: Exceptions and Advanced File IO56 Questions
Exam 12: A First Look at GUI Applications60 Questions
Exam 13: Advanced GUI Applications58 Questions
Exam 14: Applets and More54 Questions
Exam 15: Creating GUI Applications With Javafx and Scene Builder40 Questions
Exam 16: Recursion42 Questions
Exam 17: Databases48 Questions
Select questions type
What would be the results of the following code? int[] array1 = new int[25];
… // Code that will put values in array1
Int value = array1[0];
For (int a = 1; a < array1.length; a++)
{
If (array1[a] < value)
Value = array1[a];
}
(Multiple Choice)
4.9/5
(34)
An ArrayList object automatically expands in size to accommodate the items stored in it.
(True/False)
4.8/5
(29)
Given the following two-dimensional array declaration, which statement is true? int [][] numbers = new int [6] [9];
(Multiple Choice)
4.9/5
(32)
If numbers is a two-dimensional int array that has been initialized and total is an int that has been set to 0, which of the following will sum all the elements in the array?
(Multiple Choice)
5.0/5
(28)
What do you call the number that is used as an index to pinpoint a specific element within an array?
(Multiple Choice)
4.9/5
(33)
Given that String[] str has been initialized, to get a copy of str[0] with all characters converted to upper case, use the following statement:
(Multiple Choice)
4.9/5
(35)
When an array of objects is declared, but not initialized, the array values are set to null.
(True/False)
4.8/5
(35)
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
(33)
What will be the value of x[1] after the following code is executed? int[] x = {22, 33, 44};
ArrayProcess(x);
…
Public static void arrayProcess(int[] a)
{
For(int k = 0; k < 3; k++)
{
A[k] = a[k] + 5;
}
}
(Multiple Choice)
4.9/5
(42)
In Java, you do not use the new operator when you use a(n):
(Multiple Choice)
4.8/5
(42)
Which of the following is a correct method header for receiving a two-dimensional array as an argument?
(Multiple Choice)
4.7/5
(34)
What will be the value of x[8] after the following code has been executed? final int SUB = 12;
Int[] x = new int[SUB];
Int y = 100;
For(int i = 0; i < SUB; i++)
{
X[i] = y;
Y += 10;
}
(Multiple Choice)
4.7/5
(35)
An array can hold multiple values of several different data types simultaneously.
(True/False)
4.9/5
(28)
What will be returned from the following method? public static float[] getValue(int x)
(Multiple Choice)
4.9/5
(42)
Which of the following is a correct method header for receiving a two-dimensional array as an argument?
(Multiple Choice)
4.9/5
(36)
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.8/5
(32)
What will be the value of x[8] after the following code has been 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
(39)
Which of the following is a valid declaration for a ragged array?
(Multiple Choice)
4.8/5
(41)
Showing 21 - 40 of 64
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)