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.
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 Answer of Questions and ASK to Doubt