What is mean by final class, methods and variables ?

What is mean by final class, methods and variables ?

A final keyword is used to prevent the inheritance if it is used with the methods and classes. 

If we modify a class with the final modifier, it means, that class can\'t be subclassed, i.e. we can not make a subclass of final class.If we declare a method to final, it means, that method will not be inheritin the subclass of that class in which the final method is declared.If we declared a final variable, it means, that the value of the variable can not be modified once it is initialized.


By:Jalees
Date:2012-01-09 00:00:00

Post Your Answers


User Email:

User Name:
Answers:

Related Java Subjective Links

Java Subjective interview questions and answers for experienced and fresher