Title: Use the keyword final to prevent inheritance.
Course: Java Programming (Oracle) (10055) > Section: Using Inheritance

Using the final modifier should include applying it in situations where the programmer does not want the class or field changed by inheritance or reassignment. A totally abstract class may contain only final variables and abstract methods as follows:

public abstract class GenericVehicle{

/*Creation of a class that is too general to be really useful can act as the "organizational tool" for subclasses. The abstract modifier ensures that the class can never be instantiated, but it can be extended. If it is extended, all methods must be overridden.*/

final int noOfDoors = 2;
final int noOfWheels= 4;
final int tireSize= 16;

//All subclasses of GenericVehicle will have 2 doors, 4 wheels, and size 16 tires, but each subclass of GenericVehicle will be required to supply its own code for stop() and go();

public abstract void go( ) ;
public abstract void stop( ) ;

/*include one more method to show that not all methods in an abstract class must be abstract as well */

public int getDoors( ){
return noOfDoors = 2;
}