Question: What will the following code print when compiled and run? public abstract class Bird{ void fly() { System.out.println(Bird is flying); } public static void

What will the following code print when compiled and run? public abstract

What will the following code print when compiled and run? public abstract class Bird{\ void fly() { System.out.println("Bird is flying"); } public static void main(String[] args) { Bird bird = new Pelican (); // bird.fly(); } } class Pelican extends Bird{ protected void fly() { System.out.println("Pelican is flying"); }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Output Pelican is flying Explanation In the Given code Pelican class extend... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!