Database-Management-System
November 5, 2023
Question 1232 – Nielit STA [02-12-2018]
November 5, 2023
Database-Management-System
November 5, 2023
Question 1232 – Nielit STA [02-12-2018]
November 5, 2023

OOPS

Question 109
The design of a class in C++ which can’t be inherited is achieved using ___ keyword before class declaration.
A
Final
B
Static
C
Sealed
D
Fixed
Question 109 Explanation: 
→ Final is a non-access modifier applicable only to a variable, a method or a class.
→ Final variable are used to create constant variables
→ Final methods are used to prevent method overriding
→ Final Classes are prevent inheritance
→ We make the Final class non-inheritable. When a class Derived tries to inherit from it, we get compilation error.
Correct Answer: A
Question 109 Explanation: 
→ Final is a non-access modifier applicable only to a variable, a method or a class.
→ Final variable are used to create constant variables
→ Final methods are used to prevent method overriding
→ Final Classes are prevent inheritance
→ We make the Final class non-inheritable. When a class Derived tries to inherit from it, we get compilation error.
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!!