What is the final method in Java?

If we change any method to a final method, we can’t override it.

  1. class Bike{
  2.   final void run(){System.out.println(“running”);}
  3. }
  4. class Honda extends Bike{
  5.    void run(){System.out.println(“running safely with 100kmph”);}
  6.    public static void main(String args[]){
  7.    Honda honda= new Honda();
  8.    honda.run();
  9.    }
  10. }
Output:Compile Time Error