class Animal {
void makeSound() {
System.out.println("Animal sound");
}
}
class Dog extends Animal {
void makesound() { // Wrong: method name is misspelled
System.out.println("Woof!");
}
}
public class Main {
public static void main(String[] args) {
Animal myDog = new Dog();
myDog.makeSound(); // This line tries to call makeSound()
}
}
Main.java:8: error: method does not override or implement a method from a supertype @Override ^ 1 error