Self-Assessment Exercises
Chapter 11:
Two-Dimensional Arrays
1.
Studies of patterns derived from ________ theories and ________ Game of Life can be applied to traffic pattern analysis, human disease research, and the creation of like-like machines.
a.
Donald E. Knuth’s, Niklaus Wirth’s
b.
Scott G. McNealy’s, Bill Gates's
c.
Alfred E. Neuman’s, Tim Conway’s
d.
John von Neumann’s, John Conway’s
2.
A Java two-dimensional array might be used to model ________.
a.
one row of the Game of Life
b.
time/space problems
c.
a database table
d.
All of the above
3.
To iterate a two-dimensional array you should use ________.
a.
nested decision statements
b.
nested
for
statements
c.
nested loops of any kind
d.
recursion
4.
The
String
class has a method called
indexOf()
that returns the ________.
a.
address where the string is stored in memory
b.
array containing the letters of the string
c.
length of the string
d.
offset of a letter in the string
5.
Which of the following is true?
a.
A
StringBuffer
object can only be created from an existing
String
object.
b.
String
objects are immutable.
c.
StringBuffer
objects are immutable.
d.
The
String
class was designed for efficient string modification.