Filters
Question type

Study Flashcards

To access the element at row i and column j of a two-dimensional array named grades, we would use which of the following?


A) grades
B) grades[ i ][ j ]
C) grades[ j ][ i ]
D) grades( i ) ( j )
E) grades( j ) ( i )

F) B) and C)
G) A) and E)

Correct Answer

verifed

verified

When processing the elements of a two-dimensional array one row at a time, we should __________ the row processing variables before processing each row.

Correct Answer

verifed

verified

Three-dimensional arrays are not allowed in Java.

A) True
B) False

Correct Answer

verifed

verified

How many empty sets of brackets are needed to declare an array?


A) One
B) Two
C) At least two sets are needed
D) It depends on how many dimensions are involved

E) C) and D)
F) B) and C)

Correct Answer

verifed

verified

Use add( E element ) in the ArrayList class to update a list of slang terms with additional terms.

A) True
B) False

Correct Answer

verifed

verified

The ArrayList class belongs to which package?


A) java.lang
B) java.text
C) java.util
D) java.list
E) java.array

F) C) and D)
G) A) and D)

Correct Answer

verifed

verified

To process all the elements of a two-dimensional array, we use a double loop.

A) True
B) False

Correct Answer

verifed

verified

Why can you not print the contents of an array using only the array name?


A) Java does not support aggregate operations on multidimensional arrays.
B) Java does not support aggregate operations on single-dimensional arrays.
C) Each element in an array must be processed individually.
D) All of these are correct.

E) C) and D)
F) A) and B)

Correct Answer

verifed

verified

A method cannot return a two-dimensional array parameter.

A) True
B) False

Correct Answer

verifed

verified

Theorize why the following code would generate compiler errors: int [ ][ ] highTemps = new int [2][3]; highTemps = { { 89, 85, 98 }, { 88, 90, 92 } };

Correct Answer

verifed

verified

The array has already been ins...

View Answer

The syntax for declaring a multidimensional array requires the brackets to follow the array name.

A) True
B) False

Correct Answer

verifed

verified

Simeon wants to keep track of his batting average for each day of each week of the next baseball season. Evaluate what is wrong with this code and recommend an alternative code. double [ ] battingAverage;

Correct Answer

verifed

verified

We should use a two-dimensiona...

View Answer

Compare the function of the following two statements: arrayName.length arrayName[i].length

Correct Answer

verifed

verified

The first syntax allows us to ...

View Answer

When a multidimensional array is instantiated, elements of arrays with numeric types are initialized to null.

A) True
B) False

Correct Answer

verifed

verified

Jessica wants to design a search engine for an online dictionary of software-related terms. Which class should she use?


A) Array class
B) Auto class
C) ArrayList class
D) Assign class

E) None of the above
F) A) and C)

Correct Answer

verifed

verified

To process elements of a three-dimensional array, use a double for loop.

A) True
B) False

Correct Answer

verifed

verified

Why is it a good idea to check that the current column number is less than arrayName[i].length before attempting to access arrayName[i][j]?


A) Rows might have a different number of columns.
B) Accessing columns that do not exist will result in ArrayIndexOutofBoundsException at run time.
C) The column number must be within the range of 0 to arrayName[i].length - 1.
D) All of these are correct.

E) None of the above
F) A) and B)

Correct Answer

verifed

verified

Why would you want to insert a comma between two array names in one statement?


A) It allows you to instantiate multiple multidimensional arrays of the same data type.
B) It allows you to declare multiple multidimensional arrays of different data types.
C) It allows you to declare multiple multidimensional arrays of the same data type.
D) It allows you to instantiate single arrays of the same data type.

E) None of the above
F) A) and B)

Correct Answer

verifed

verified

The ArrayList class uses generics.

A) True
B) False

Correct Answer

verifed

verified

To access the number of columns in row i of a two-dimensional array named grades, we would use which of the following?:


A) grades.length
B) grades[ i ].length
C) grades( i ) .length
D) grades( i ) .size
E) grades{ i }.length

F) A) and D)
G) None of the above

Correct Answer

verifed

verified

Showing 21 - 40 of 62

Related Exams

Show Answer