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.