Answers.
The header public boolean equals(Date otherDate) is best described as an:
A. overload of the equals method
B. override of the equals method
C. masking of the equals method
D. overbooking of the equals method - Correct answer A
The Model-Delegate design pattern only works with GUI programming (T/F) - Correct
answer F
Most, but not all, of the wrapper classes are spelled the same as the keyword for the
primitive data type that they "wrap," but with an initial capital letter. Which wrappers
don't follow this rule?
A. Float, Double
B. Integer, Short, Long
C. Integer, Character
D. Character, Byte - Correct answer C
An instance variable of a class can be of an array type (T/F) - Correct answer T
A copy constructor should:
(1) be a constructor with a single argument of the same type as the class
(2) create an entirely spearate object, with identical data values as in the original
object
(3) never use the new operator (because it causes data leaks)
(4) be created when a class contains instance variables that are of non-primitive
types
A. Only statement (3) is false
B. All four statements are true
C. (1) and (2) are true
D. Only statement (4) is false - Correct answer A
The Model-View-Controller design pattern only works with GUI programming (T/F) -
Correct answer F
Which of the following is true?
A. An interface may not have any instance variables
B. An interface may not have any constructors
C. An interface may have abstract methods
, D. All of the above
E. None of the above - Correct answer D
A common use of inner classes is
A. clean up
B. burn down
C. helper
D. all of the above - Correct answer C
In even the most basic Java GUI programming, the JFrame class contains many
methods that must be overridden (T/F) - Correct answer F
A button fires events known as
A. static events
B. passive events
C. dormant events
D. action events - Correct answer D
A Java generic is a class or method that includes a type as a parameter (T/F) -
Correct answer T
The ___ manager is the simplest layout manager in Java. It arranges components
one after the other, going from left to right, in order in which you add them
A. BorderLayout
B. FlowLayout
C. GridLayout
D. AbsoluteLayout - Correct answer B
Anonymous classes are not supported in Java (T/F) - Correct answer F
A list is an abstract data type that is sequential, homogeneous, and dynamic (T/F) -
Correct answer T
The most common relationships among classes are inheritance, composition,
association, and aggregation (T/F) - Correct answer T
In the Model-View-Controller pattern, a passive View contains a reference to the
Controller, but not to the model (T/F) - Correct answer F
The first node in a linked list is often referred to as the ___ node.
A. head
B. tail