Programming - Inheritance
You Are Here :: Home > JAVA > Inheritance - General Questions
19. |
Object class is a superclass of all other classes?
|
A. |
TRUE |
B.
|
FALSE |
C.
|
Can't Say
|
D.
|
None
|
|
Answer: Option A
Explanation:
|
20. |
Java supports multiple inheritance?
|
A. |
FALSE |
B.
|
TRUE |
C.
|
Can't Say
|
D.
|
None
|
|
Answer: Option A
Explanation:
|
21. |
What is inheritance?
|
A. |
Deriving an object from an existing class. In the other words, Inheritance is the process of inheriting all the features from a class |
B.
|
Deriving an object from an existing class. In the other words, Inheritance is the process of inheriting all the features from a object |
C.
|
Deriving an object from an existing class. In the other words, Inheritance is the process of inheriting all the features from a variable
|
D.
|
Deriving an object from an existing class. In the other words, Inheritance is the process of inheriting all the features from a method
|
|
Answer: Option A
Explanation:
|
22. |
What are the advantages of inheritance?
|
A. |
Reusability of code and accessibility of variables and methods of the superclass by subclasses. |
B.
|
Reusability of code and accessibility of class of the superclass by subclasses. |
C.
|
Reusability of code and accessibility of functions of the superclass by subclasses.
|
D.
|
Reusability of code and accessibility of variables and methods of the parentclass by subclasses.
|
|
Answer: Option A
Explanation:
|
23. |
Which method is used to call the constructors of the superclass from the subclass?
|
A. |
super(argument) |
B.
|
super(method) |
C.
|
super(variable)
|
D.
|
super(classname)
|
|
Answer: Option A
Explanation:
|
24. |
Which is used to execute any method of the superclass from the subclass?
|
A. |
super.method-name(arguments) |
B.
|
super.method-name(method) |
C.
|
super.method-name(variable)
|
D.
|
super.method-name(classname)
|
|
Answer: Option A
Explanation:
|
« prev
next »