The 'java ch9' quiz assesses understanding of Java inheritance concepts, including superclass\/subclass relationships, the 'is-a' relationship, and the use of 'super' and 'protected' keywords. It is ideal for learners aiming to enhance their Java OOP skills.
“knows-a” relationship.
“has-a” relationship.
“uses-a” relationship.
“is-a” relationship.
Rate this question:
Ford/Taurus.
University/Brown University
Sailboat/Tugboat
Country/USA
Rate this question:
All methods can be inherited
All instance variables can be uniformly accessed by subclasses and superclasses.
Objects of a subclass can be treated like objects of their superclass.
None of the above.
Rate this question:
base.
This
Public
Super
Rate this question:
Public access.
B. package access.
C. private access.
D. block scope.
Rate this question:
A. private.
B. public.
C. protected.
D. package.
Rate this question:
A. Integer.
B. Object.
C. String.
D. Class.
Rate this question:
A. Overloaded methods have the same signature.
B. Overridden methods have the same signature.
C. Both of the above.
D. Neither of the above.
Rate this question:
A. inheritance, the “copy-and-past” approach.
B. the “copy-and-past” approach, inheritance.
C. a class that explicitly extends Object, a class that does not extend Object.
D. a class that does not extend Object, a class that explicitly extends Object.
Rate this question:
A. Both variables a and b are instance variables.
B. After the constructor for class B executes, the variable a will have the value 7.
C. After the constructor for class B executes, the variable b will have the value 8.
D. A reference of type A can be treated as a reference of type B.
Rate this question:
A. keyword super, followed by a dot (.) .
B. keyword super, followed by a set of parentheses containing the superclass constructor arguments.
C. keyword super, followed by a dot and the superclass constructor name.
D. None of the above.
Rate this question:
A. private instance variables and methods.
B. protected instance variables and methods.
C. private constructors.
D. protected constructors.
Rate this question:
A. A subclass object can assign an invalid value to the superclass’s instance variables, thus leaving an object in an inconsistent state.
B. Subclass methods are more likely to be written so that they depend on the superclass’s data implementation.
C. We may need to modify all the subclasses of the superclass if the superclass implementation changes.
D. All of the above.
Rate this question:
A. by calling private methods declared in the superclass.
B. by calling public or protected methods declared in the superclass.
C. directly.
D. All of the above.
Rate this question:
A. a compile-time error.
B. a syntax error.
C. infinite recursion.
D. a runtime error.
Rate this question:
A. A syntax error occurs.
B. A compile-time error occurs.
C. A run-time error occurs.
D. The program compiles and runs because the instance variables are initialized to their default values.
Rate this question:
A. All of the above.
B. None of the above.
C. A, B and C.
D. A, B and D.
Rate this question:
A. Both ducks and geese are birds that know how to start flying from the water.
B. All vehicles know how to start and stop.
C. All animals lay eggs, except for mammals.
D. All paints have a color.
Rate this question:
A. empty copy.
B. deep copy.
C. full copy.
D. shallow copy.
Rate this question:
A. whether two references refer to the same object in memory.
B. whether two references have the same type.
C. whether two objects have the same instance variables.
D. whether two objects have the same instance variable values.
Rate this question:
A. Image.
B. Icon.
C. ImageIcon.
D. IconImage.
Rate this question:
A. changeText.
B. setText.
C. changeLabel.
D. setLabel.
Rate this question:
Quiz Review Timeline (Updated): Mar 21, 2023 +
Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.
Wait!
Here's an interesting quiz for you.