Question: QUESTION 12 A subclass inherits all its data members from the superclass; it has none of its own. True False QUESTION 13 Java uses late
QUESTION 12
A subclass inherits all its data members from the superclass; it has none of its own.
True
False
QUESTION 13
Java uses late binding for methods that are private but not for methods that are marked final.
True
False
QUESTION 14
Using the mechanism of inheritance, every public member of the class Object can be overridden and/or invoked by every object of any class type.
True
False
QUESTION 15
In Java, a reference variable of a superclass type cannot point to an object of its subclass.
True
False
QUESTION 16
An abstract class can only contain abstract methods.
True
False
QUESTION 17
The class Object is directly or indirectly the superclass of every class in Java.
True
False
QUESTION 18
In Java, you can automatically make a reference variable of a subclass type point to an object of its superclass.
True
False
QUESTION 19
A subclass can have its own private data members, but a subclass cannot have its own constructors.
True
False
QUESTION 20
Suppose that the class Mystery is derived from the class Secret. The following statements are legal in Java. Secret secRef; Mystery mysRef = new Mystery(); secRef = mysRef;
True
False
QUESTION 21
Redefining a method of a superclass is also known as overloading a method.
True
False
QUESTION 22
The subclass can override public methods of a superclass.
True
False
QUESTION 23
Composition is a is-a relation.
True
False
QUESTION 24
The superclass inherits all its properties from the subclass.
True
False
QUESTION 25
An abstract method is a method that has only the heading with no body.
True
False
QUESTION 26
Every Java class (built-in or user-defined) automatically includes the method toString.
True
False
QUESTION 27
Composition is a has-a relation.
True
False
QUESTION 28
To override a public method of a superclass in a subclass, the corresponding method in the subclass must have the same name but a different number of parameters.
True
False
QUESTION 29
You can instantiate an object of a subclass of an abstract class, but only if the subclass gives the definitions of all the abstract methods of the superclass.
True
False
Inheritance implies an is-a relationship.
True
False
QUESTION 31
The private members of a superclass can be accessed by a subclass.
True
False
QUESTION 32
In Java, extends is a reserved word.
True
False
QUESTION 33
A call to the default constructor of a superclass must be the first statement in a constructor.
True
False
QUESTION 34
Inheritance implies an has-a relationship.
True
False
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
