Question 22
Consider the following Java code.
1. class Animal {2. protected final void makeSound() {3. System.out.println("Animal makes sound");4. }5. }6. class Bird {7. public void fly() {8. System.out.println("Bird flies");9. }10. }11. class Parrot extends Animal, Bird {12. public void makeSound() {13. System.out.println("Parrot squawks");14. }15. }16. public class TestProgram {17. public static void main(String[] args) {18. Parrot p1 = new Animal();19. }20. }Identify the line/s which has/have errors.
Line 2
Line 7
Line 11
Line 12
Line 18