Engineering-Mathematics
October 9, 2023
NIC-NIELIT Scientist-B 2020
October 9, 2023
Engineering-Mathematics
October 9, 2023
NIC-NIELIT Scientist-B 2020
October 9, 2023

OOPS

Question 31
Consider the following two statements:
(a) A publicly derived class is a subtype of its base class.
(b) Inheritance provides for code reuse.
A
Both the statements (a) and (b) are correct.
B
Neither of the statements (a) and (b) are correct
C
Statement (a) is correct and (b) is incorrect
D
Statement (a) is incorrect and (b) is correct.
Question 31 Explanation: 
→ A publicly derived class is a subtype of its base class.
→ Inheritance is defined as deriving new classes (sub classes) from existing ones (super class or base class) and forming them into a hierarchy of classes.
→ Inheritance allows programmers to create classes that are built upon existing classes, to specify a new implementation while maintaining the same behaviors (realizing an interface), to reuse code and to independently extend original software via public classes and interfaces.
Correct Answer: A
Question 31 Explanation: 
→ A publicly derived class is a subtype of its base class.
→ Inheritance is defined as deriving new classes (sub classes) from existing ones (super class or base class) and forming them into a hierarchy of classes.
→ Inheritance allows programmers to create classes that are built upon existing classes, to specify a new implementation while maintaining the same behaviors (realizing an interface), to reuse code and to independently extend original software via public classes and interfaces.
0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
error: Alert: Content selection is disabled!!