class Animal2 { void eat() { System.out.println("animal : eat"); } } class Dog extends Animal2 { void eat() { System.out.println("dog : eat"); } void eatTest() { this.eat(); super.eat(); } } public class Test { public static void main(String[] args) { Animal2 a = new Animal2(); a.eat(); Dog d = new Dog(); d.eatTest(); } }