Computer Science, asked by dastagiri3160, 11 months ago

A class can be declared as __________ if it should not be sub classed.

Answers

Answered by paranjapeabha17
1

Answer:

final

Class should be declared final if it should not be subclassed

Answered by dreamrob
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