A class can be declared as __________ if it should not be sub classed.
Answers
Answered by
1
Answer:
final
Class should be declared final if it should not be subclassed
Answered by
0
A class can be declared as final if you do not want the class to be sub-classed.
- The final class is declared with the final keyword.
- This final class cannot be extended or inherited.
- The final keyword is used to prevent inheritance so that no subclass can be inherited from it.
- If someone tries to inherit a subclass from the final class the compiler will give an error.
Similar questions
Hindi,
5 months ago
Science,
5 months ago
Math,
5 months ago
India Languages,
11 months ago
India Languages,
11 months ago
Science,
1 year ago