Method Overriding INPUT class Human{      public void eat()    {       System.out.println("Human is eating");    } } class Boy ext...

Write a java program to implement method overriding | VCMIT

Method Overriding



INPUT

class Human{
 
   public void eat()
   {
      System.out.println("Human is eating");
   }
}
class Boy extends Human{
 
   public void eat(){
      System.out.println("Boy is eating");
   }
   public static void main( String args[]) {
      Boy obj = new Boy();
   
      obj.eat();
   }
}

OUTPUT



0 coment�rios: