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



Disqus Comments
TheWaoFam. يتم التشغيل بواسطة Blogger.

إجمالي مرات مشاهدة الصفحة

بحث هذه المدونة الإلكترونية

  • ()

Random Posts

randomposts

Recent Posts

recentposts

Footer Link

Connected

Facebook

banner image

Most Recent

نموذج الاتصال

Categories

There are many variations of passages of Lorem Ipsum available.

About Me

Hi there, I’m Amanda – a girl love fashion and love to express herself with her own sense of style.

Trending