QUESTIONS AND ANSWERS UPDATED
When declared as "protected", data in an object can be
accessed by __________.
A. Only by that class's methods and by all of its subclasses
B. Only by that class's methods, by all of its subclasses, and by
methods in classes within the same package
C. Only by that class's methods
D. By any class
B. Only by that class's methods, by all of its subclasses, and by
methods in classes within the same package
Which of the following statements about classes is not true?
A. You cannot create n object from a class declared with a
keyword "final"
B. You can override methods in a class declared with the
keyword "final"
C. You cannot extend a class declared with the keyword "final"
D. You cannot create subclasses from a class declared with
the keyword "final"
B. You can override methods in a class declared with the
keyword "final
A class from which you cannot create objects is called a/an
_________
, A. Abstract class
B. Concrete class
C. Non-inheritance class
D. Superclass
A. Abstract class
Which of the following statements about classes is true?
A. You can create an object from a concrete class, but not from
an abstract class
B. You can create an object from an abstract class, but not
from a concrete class
C. You cannot have an object reference whose type is an
abstract class
D. You cannot create subclasses from abstract classes
A. You can create an object from a concrete class, but not from
an abstract class
Which of the following is true regarding subclasses?
A. A subclass has access to private instance variables of its
superclass
B. A subclass doe not have access to public instance variables
of its superclass
C. A subclass must specify the implicit parameter to use
methods inherited from its superclass