COSC-1337 Chapter 10 Quiz
All fields declared in an interface: a. are final and static b. have protected access c. must be initialized in the class implementing the interface d. have private access
a. are final and static
An abstract method has: a. only a header and no body b. only a body and no header c. body ends with a semicolon. d. no header and no body
a. only a header and no body
A subclass may call an overridden superclass method by: a. prefixing its name with the super key word and a dot (.) b. prefixing its name with the name of the superclass in parentheses c. using the extends keyword before the method is called d. calling the superclass method first and then calling the subclass method
a. prefixing its name with the super key word and a dot (.)
Like a family tree, a ________ shows the inheritance relationship between classes. a. flowchart b. class map c. class hierarchy d. binary tree
c. class hierarchy
The super statement that calls the superclass constructor: a. must be the first statement in the superclass's constructor b. can appear in any method of the subclass c. must be the first statement in the subclass's constructor d. is deprecated and is no longer supported in newer versions of Java
c. must be the first statement in the subclass's constructor
All methods specified by an interface has default a. private access b. protected access c. public access d. packaged access
c. public access
What key word can you use to call a superclass constructor explicitly? a. goto b. this c. super d. extends
c. super
A protected member of a class may be directly accessed by: a. methods of the same class b. methods of a subclass c. methods in the same package d. All of the above
d. All of the above
When an "is a" relationship exists between objects, it means that the specialized object has: a. some of the characteristics of the general class, but not all, plus additional characteristics b. some of the characteristics of the general object, but not all c. none of the characteristics of the general object d. all the characteristics of the general object, plus additional characteristics
d. all the characteristics of the general object, plus additional characteristics
If you do not provide an access specifier for a class member, the class member is given ________ by default. a. private access b. public access c. protected access d. package access
d. package access