and Answers| Latest Update
Which of the following statements about abstract superclasses is true?
A. abstract superclasses may contain data.
B. abstract superclasses may not contain implementations of methods.
C. abstract superclasses must declare all methods as abstract.
D. abstract superclasses must declare all data members not given values as abstract. ✔️✔️A.
abstract superclasses may contain data.
Consider classes A, B and C, where A is an abstract superclass, B is a concrete class that inherits
from A and C is a concrete class that inherits from B. Class A declares abstract method
originalMethod, implemented in class B. Which of the following statements is true of class C?
A. Method originalMethod cannot be overridden in class C—once it has been implemented in
concrete class B, it is implicitly final.
B. Method originalMethod must be overridden in class C, or a syntax error will occur.
C. If method originalMethod is not overridden in class C but is called by an object of class C, an
error occurs.
D. None of the above. ✔️✔️D. None of the above.
When a superclass variable refers to a subclass object and a method is called on that object, the
proper implementation is determined at execution time. What is the process of determining
the correct method to call?
A. execution time binding.
B. execution binding.
C. just-in-time binding.
D. late binding ✔️✔️D. late binding.
, Every object in Java knows its own class and can access this information through method .
A. getClass.
B. getInformation.
C. objectClass.
D. objectInformation. ✔️✔️A. getClass.
Assigning a subclass reference to a superclass variable is safe:
A. because the subclass object has an object of its superclass.
B. because the subclass object is an object of its superclass.
C. only when the superclass is abstract.
D. only when the superclass is concrete. ✔️✔️B. because the subclass object is an object of its
superclass.
Classes and methods are declared final for all but the following reasons:
A. final methods allow inlining the code.
B. final methods and classes prevent further inheritance.
C. final methods are static.
D. final methods can improve performance. ✔️✔️C. final methods are static.
All of the following methods are implicitly final except:
A. a method in an abstract class.
B. a private method.