final method in Java

A final method cannot be overridden or hidden by sub-classes. This is used to prevent unexpected behavior from a subclass altering a method that may be crucial to the function or consistency of the class.
```
class Bike{  
    final void run(){ System.out.println("running"); }  
}  
     
class Honda extends Bike{  
    void run(){ System.out.println("running safely with 100kmph"); }  
     
    public static void main(String args[]){  
        Honda honda= new Honda();  
        honda.run();  
    }  
} 

// error: run() in Honda cannot override run() in Bike
```