you can also like us
A subclass is generally larger than its superclass.
A superclass object is a subclass object.
The class following the extends keyword in a class declaration is the direct superclass of the class being declared.
Java uses interfaces to provide the benefits of multiple inheritance.
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.
B. package access.
C. private access.
D. block scope.
A. Overloaded methods have the same signature.
B. Overridden methods have the same signature.
C. Both of the above.
D. Neither of the above.
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.
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.
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.
A. private instance variables and methods.
B. protected instance variables and methods.
C. private constructors.
D. protected constructors.
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.
A. by calling private methods declared in the superclass.
B. by calling public or protected methods declared in the superclass.
D. All of the above.
A. a compile-time error.
B. a syntax error.
C. infinite recursion.
D. a runtime error.
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.
A. All of the above.
B. None of the above.
C. A, B and C.
D. A, B and D.
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.
A. empty copy.
B. deep copy.
C. full copy.
D. shallow copy.
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.