Exam 9: Arrays
Exam 1: An Overview of Computers and Programming Languages50 Questions
Exam 2: Basic Elements of Java50 Questions
Exam 3: Introduction to Objects and Input/output50 Questions
Exam 4: Control Structures I: Selection50 Questions
Exam 5: Control Structures II: Repetition50 Questions
Exam 6: Graphical User Interface GUI and Object-Oriented Design OOD50 Questions
Exam 7: User-Defined Methods50 Questions
Exam 8: User-Defined Classes50 Questions
Exam 9: Arrays46 Questions
Exam 10: Inheritance and Polymorphism50 Questions
Exam 11: Handling Exceptions and Events50 Questions
Exam 12: Advanced Guis and Graphics48 Questions
Exam 13: Recursion50 Questions
Exam 14: Applications of Arrays Searching and Sorting and Strings50 Questions
Select questions type
In row processing, a two-dimensional array is processed one row at a time.
(True/False)
4.8/5
(38)
When an array object is instantiated, its components are initialized to their default values.
(True/False)
4.8/5
(35)
Which of the following declares an array of int named beta?
(Multiple Choice)
5.0/5
(37)
char[][] table = new char[10][5];How many columns are in the array seen in the accompanying figure?
(Multiple Choice)
4.9/5
(37)
int[] numList = new int[50];for (int i = 0; i <50; i++)
NumList[i] = 2 * i;
Num[10] = -20;
Num[30] = 8;
How many components are in the array numList seen in the accompanying figure?
(Multiple Choice)
4.7/5
(31)
The array index can be any nonnegative integer less than the array size.
(True/False)
4.8/5
(36)
Suppose that you have the following declaration.int[] alpha = new int[50];
int[][] beta = new int[10][5];In this declaration, the array alpha has more components than the array beta.
(True/False)
4.8/5
(31)
char[][] table = new char[10][5];How many dimensions are in the array seen in the accompanying figure?
(Multiple Choice)
4.8/5
(38)
Suppose you have the following declaration.double[] salesData = new double[500];Which of the following range is valid for the index of the array salesData.
(i) 0 through 500
(ii) 0 through 499
(Multiple Choice)
4.8/5
(38)
char[][] table = new char[10][5];What is the value of table.length?
(Multiple Choice)
4.7/5
(33)
Given the declaration int[] list = new int[50];the statementSystem.out.println(list[0] + "..." + list[49]);outputs all 50 components of the array list.
(True/False)
4.8/5
(35)
The method size in the class Vector returns the number of elements in the vector.
(True/False)
4.8/5
(38)
The following statement creates alpha to be a two-dimensional array of 35 components. int[][] alpha = new int[20][15];
(True/False)
4.9/5
(34)
int[] list = {1, 3, 5, 7};(int i = 0; i < list.length; i++)
If (list[i] > 5)
System.out.println(i + " " + list[i]);Which indices are in bounds for the array list, given the declaration in the accompanying figure?
(Multiple Choice)
4.7/5
(35)
A single array can hold components of many different data types.
(True/False)
4.8/5
(33)
If an array index is less than or equal to zero, an InvalidIndexException exception is thrown.
(True/False)
4.8/5
(32)
Showing 21 - 40 of 46
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)