HTML & JS
class Override01
{
     public void Display()
     {
         System.out.println("We are with Override method....");
     }
}
class TestOverride01 extends Override01
{
     @Override
     public void Display(int x)
     {
         System.out.println("We r in Test Override.......");
     }
 
     public static void main(String args[])
     {
         TestOverride01 t1 = new TestOverride01();
         t1.Display();
     }
}

Generated URL:

Warnings:

10: error: method does not override or implement a method from a supertype
     @Override
     ^
1 error

Runtime Errors:

Error: Main method not found in class Override01, please define the main method as:
   public static void main(String[] args)

Output:

No Output
Report Bug