Final Class:- If we want to protect class from inheritance then we can create final class.
final class Classname
{
}
Final Method:- if we want to protect method from overriding then we can create final method.
final returntype methodname() #never override
{
}
Final Variable:- If we want to create constant in java then we can create final variable.
Post a Comment
If you have any doubt in programming or join online classes then you can contact us by comment .