Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  poly
Language: JAVA
Code:
package pkg1;

import java.util.*;
import java.lang.*;
import java.io.*;


class Bird
{
     public void fly()
     {
          System.out.println("Bird is flying");
          
     }
     public static void main (String[] args) 
     {
          Bird bird = new Bird();
          bird.fly();
          Eagle eagle = new Eagle(); 
          eagle.fly();
     }
}
class Eagle extends Bird
{
     public void fly()
     {
          System.out.println("Eagle is flying");
     }
     
}
Comments: