Java Programming

Computing

Quiz 10 :

Inheritance and Polymorphism

Quiz 10 :

Inheritance and Polymorphism

Question Type
search
arrow
In Java, stream classes are implemented using the inheritance mechanism.
Free
True False
Answer:

Answer:

True

Tags
Choose question tag
close menu
arrow
If a class is declared final, then no other class can be derived from this class.
Free
True False
Answer:

Answer:

True

Tags
Choose question tag
close menu
arrow
The superclass inherits all its properties from the subclass.
Free
True False
Answer:

Answer:

False

Tags
Choose question tag
close menu
arrow
The class Object is directly or indirectly the superclass of every class in Java.
True False
Answer:
Tags
Choose question tag
close menu
arrow
A polymorphic reference variable can refer to either an object of its own class or an object of the subclasses inherited from its class.
True False
Answer:
Tags
Choose question tag
close menu
arrow
In Java, polymorphism is implemented using late binding.
True False
Answer:
Tags
Choose question tag
close menu
arrow
A subclass cannot directly access public members of a superclass.
True False
Answer:
Tags
Choose question tag
close menu
arrow
You must always use the reserved word super to use a method from the superclass in the subclass.
True False
Answer:
Tags
Choose question tag
close menu
arrow
In dynamic binding, the method that gets executed is determined at compile time, not at execution time.
True False
Answer:
Tags
Choose question tag
close menu
arrow
A subclass inherits all its data members from the superclass; it has none of its own.
True False
Answer:
Tags
Choose question tag
close menu
arrow
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
Answer:
Tags
Choose question tag
close menu
arrow
In multiple inheritance, the subclass is derived from more than one superclass.
True False
Answer:
Tags
Choose question tag
close menu
arrow
A subclass can directly access protected members of a superclass.
True False
Answer:
Tags
Choose question tag
close menu
arrow
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
Answer:
Tags
Choose question tag
close menu
arrow
Redefining a method of a superclass is also known as overloading a method.
True False
Answer:
Tags
Choose question tag
close menu
arrow
A subclass can override public methods of a superclass.
True False
Answer:
Tags
Choose question tag
close menu
arrow
In Java, you can automatically make a reference variable of a subclass type point to an object of its superclass.
True False
Answer:
Tags
Choose question tag
close menu
arrow
Inheritance implies an "is-a" relationship.
True False
Answer:
Tags
Choose question tag
close menu
arrow
The private members of a superclass can be accessed by a subclass.
True False
Answer:
Tags
Choose question tag
close menu
arrow
Java uses late binding for methods that are private but not for methods that are marked final.
True False
Answer:
Tags
Choose question tag
close menu
Showing 1 - 20 of 50