Overriding:

--> Having same instance function in parent and child class with same signature.

Rules for overriding:

1.The function should not be "private" in parent class. 2.The function should not be "final" in parent class. Example:
 	   class Dot
           { 
  	         int x,y;
 	         public Dot(int a, int b)
  	         {
   	            x=a;
  	            y=b;
	          }
	         public void findArea()
   	         {
 	           System.out.println("Area is 1");
  	         }
	    }
	   class Rect extends Dot
	   {
	          int len,bred;
  	          public Rect(int l, int b)
	          {  
	              len = l;
  	              bred = b;
  	           }
  	           public void findArea()
	           {
   	               System.out.println("Area is..."+(len*bred));
  	           }
	     }
	    public class MainClass
	      {
 	          public static void main(String[ ] args)
  	          {
   	            Rect r=new Rect(4,5);
    	            r.findArea();
   	            Dot d= new Dot(1,2);
      	            d.findArea();
                  }
               }
Note: If we are making any function call on derived object then first java will check if that function is existing in derived class or not.If it is not and then it will call base class function. Overriding
            class Parent
            {
 	        public void getCycle()
	        {
   	            System.out.println("my cycle");
  	        }	
	        public void getBike()
	        { 
  	            System.out.println("Honda bike");
	        }
	    }
	    class Child extends Parent
	     {
  	         public void getBike()
  	         {
    	           System.out.println("pulsar bike");
   	          }
  	          public void getCar()
	          {
   	          System.out.println("nano car");
   	           }
	       }
                     main(...)
	           {
	              Child c= new Child();
	              c.getBike();
              }