Java - Polymorphism
Examine the code below and identify the issue:
class Bird { void fly() { System.out.println("Flying"); } }
class Sparrow extends Bird { void chirp() { System.out.println("Chirp"); } }
public class Test {
public static void main(String[] args) {
Bird b = new Bird();
Sparrow s = (Sparrow) b;
s.chirp();
}
}