Computer Science, asked by engcarrion5841, 1 year ago

Fill in the blanks to define a new class falcon based on the superclass bird

Answers

Answered by yahyamg2004pak5m0
5
  class falcon extends Bird {
}

Answered by franktheruler
0

Answer:

class bird

{

  public void eat ( )

      {

        system. out. println ( " bird is eating " ) ;

      }  

}

class falcon extends bird  // create a sub class or child class

{

       public void eat ( )

      {

        system. out. println ( " falcon is eating " ) ; // override

      }  

}

class inheritance

{

 public static void main ( string args [ ] )

   {

      falcon obj = new falcon ( ); // creating object of class falcon

       obj. eat ( ) ;

    }

}

this is a concept of inheritance.

Similar questions