wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

CMP128 Java Ch. 07 Arrays

Total questions: 10

Worksheet time: 19mins

Name
Class
Date
1.
A(n) ____________ is a container for multiple variables that are interrelated, share the same name and the same data type.
a)
class
b)
array
c)
method
d)
object
2.
A one-dimensional array is a __________, like items you might want to purchase at a supermarket.
a)
table
b)
cube
c)
matrix
d)
list
3.
A two-dimensional array is a ___________ that contains multiple fields of data that are interrelated to a single record.  It field is referenced by x and y coordinates, often referred to as rows and columns.
a)
list
b)
cube
c)
table
d)
none of the above
4.
A three-dimensional array is a ____________, such as the representation of the sides of a playing die.  It contains rows and columns across several planes.
a)
matrix
b)
table
c)
list
d)
cube
5.
An array declaration contains _________ after the data type.
a)
angle brackets
b)
rectangle brackets
c)
curly braces
d)
parentheses
6.
An array declaration contains _______________________ after its array name.
a)
an assignment operator
b)
keyword new
c)
a data type and rectangle brackets with a numeric size inside it
d)
all of the above
7.
An array declaration can optionally omit the new specifier and explicit size setting if it contains a comma-delimited _______________ inside a set of _______________ after the assignment operator, which will imply its size.
a)
initialization list, parentheses
b)
parameter list, parentheses
c)
initialization list, curly braces
d)
None of the above
8.
An array uses ____________ indexing to keep track of each memory allocation unit in the array.
a)
one-based
b)
zero-based
c)
10-based
d)
100-based
9.
The first value of an array called quizzes can be accessed with which of the following statements?
a)
quizzes[1] = 100;
b)
quizzes[0] = 100;
c)
quizzes[zero] = 100;
d)
quizzes[one] = 100;
10.
Which of the following statements outputs the fifth value in the quizzes array?
a)
System.out.println(quizzes[5]);
b)
quizzes[4];
c)
quizzes[5];
d)
System.out.println(quizzes[4]);