Exam 8: Arrays and the Arraylist Class
Exam 1: Introduction to Computers and Java42 Questions
Exam 2: Java Fundamentals53 Questions
Exam 3: Decision Structures52 Questions
Exam 4: Loops and Files48 Questions
Exam 5: Methods50 Questions
Exam 6: A First Look at Classes49 Questions
Exam 7: A First Look at Gui Applications49 Questions
Exam 8: Arrays and the Arraylist Class52 Questions
Exam 9: A Second Look at Classes and Objects40 Questions
Exam 10: Text Processing and More About Wrapper Classes49 Questions
Exam 11: Inheritance49 Questions
Exam 12: Exceptions and Advanced File Io46 Questions
Exam 13: Advanced Gui Applications46 Questions
Exam 14: Applets and More39 Questions
Exam 15: Recursion34 Questions
Exam 16: Sorting, Searching, and Algorithm Analysis46 Questions
Exam 17: Generics50 Questions
Exam 18: Collections50 Questions
Exam 19: Array-Based Lists20 Questions
Exam 20: Linked Lists36 Questions
Exam 21: Stacks and Queues36 Questions
Exam 22: Binary Trees, Avl Trees, and Priority Queues45 Questions
Select questions type
What will 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:
A
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[]?
Free
(Multiple Choice)
4.8/5
(41)
Correct Answer:
C
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;
}
Free
(Multiple Choice)
4.9/5
(32)
Correct Answer:
C
The purpose of the sequential search algorithm is to rearrange the elements of an array so they appear in order from the lowest value to the highest value.
(True/False)
4.7/5
(28)
What will be the results 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)
5.0/5
(39)
Which of the following is a correct method header for receiving a two-dimensional array as an argument?
(Multiple Choice)
4.9/5
(34)
You can use this ArrayList class method to replace an item at a specific location in an ArrayList.
(Multiple Choice)
4.8/5
(39)
Java does not limit the number of dimensions that an array may have.
(True/False)
4.8/5
(32)
The String[] args parameter in the main method header allows the program to receive arguments from the operating system command-line.
(True/False)
4.9/5
(40)
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.9/5
(26)
For the following code,what would be the value of str[2]? String[] str = {"abc","def","ghi","jkl"};
(Multiple Choice)
4.7/5
(44)
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.7/5
(36)
When an individual element of an array is passed to a method
(Multiple Choice)
4.8/5
(41)
When an array of objects is declared,but not initialized,the array values are set to null.
(True/False)
4.8/5
(32)
This ArrayList class method deletes an item from an ArrayList.
(Multiple Choice)
4.7/5
(39)
What will be the value of x[1] after the following code is executed? int[] x = {22,33,44};
ArrayProcess(x[1]);
)..
Public static void arrayProcess(int a)
{
A = a + 5;
}
(Multiple Choice)
4.8/5
(42)
If numbers is a two-dimensional array,which of the following would give the length of row r?
(Multiple Choice)
4.9/5
(35)
Which of the statements are true about the following code? final int ARRAY_SIZE = 10;
Long[] array1 = new long[ARRAY_SIZE];
(Multiple Choice)
4.8/5
(32)
Showing 1 - 20 of 52
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)