Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

FINAL CLASS

Final class is another type of class. It cannot have any child or sub classes (i.e Inheritance
concept). If we create any sub class of final class then syntax error will come as “The final
class cannot have any sub-class”.

Example program for Final class:

FINAL METHOD
If only a method of class is FINAL, then that class can be inherited but that method cannot be redefined.

If you try to declare the same method using redefinition, then error shown as “ Method is not declared
or inherited in class”.

Example Program for FINAL METHOD:

You might also like