In Java, polymorphism is implemented using late binding. True False QUESTION 2 A
ID: 3913308 • Letter: I
Question
In Java, polymorphism is implemented using late binding.
True
False
QUESTION 2
A subclass cannot directly access public members of a superclass.
True
False
QUESTION 3
GUI components are placed in a window called JFrame.
True
False
QUESTION 4
A polymorphic reference variable can refer to either an object of their own class or an object of the subclasses inherited from its class.
True
False
QUESTION 5
You can instantiate an object of an abstract class.
True
False
QUESTION 6
A subclass can directly access protected members of a superclass.
True
False
QUESTION 7
Suppose that the class Mystery is derived from the class Secret. Consider the following statements:
Secret secRef;
Mystery mysRef = new Mystery();
secRef = mysRef;
The value of the expression secRef instanceof Secret is true.
True
False
QUESTION 8
Inheritance lets you create new classes from existing classes.
True
False
QUESTION 9
An interface is a class that contains only abstract methods and/or named constants.
True
False
QUESTION 10
When we instantiate a subclass object, this object inherits the instance variables of the superclass, but the subclass object cannot directly access the private instance variables of the superclass.
True
False
QUESTION 11
In dynamic binding the method that gets executed is determined at the compile time not at execution time. On the other hand, in run-time binding the method that gets executed is determined at execution time not at compile time.
True
False
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
Explanation / Answer
Q1 - True, Late binding is a way to implement polymorphism.
Q2-False, the subcalss can directly access the public members of super classs, it cannot access the privte members directly.
Q3-True, all GUI components are placed in a frame which is known as JFRAME.
Q5-False. Object of abstract classes cannot be intantiated.
Q6- True, subclass can directly access the protected members of superclass.
Q7-False, instance is always created with a new keyword.
Q8-True Inheritance allows to reuse the code used in previous classes, so we can create new classes from the previous ones.
Q9-False.
Q10-True.
Q11- false the dynamic binding is another name of tun time binding the former is defination of static binding not dynamic binding.
Q12-False- inheritence extends the functionality of super class.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.