1package animals;
2/* File name : MammalInt.java */
3public class MammalInt implements Animal {
4 public void eat() {
5 System.out.println("Mammal eats");
6 }
7 public void travel() {
8 System.out.println("Mammal travels");
9 }
10 public int noOfLegs() {
11 return 0;
12 }
13 public static void main(String args[]) {
14 MammalInt m = new MammalInt();
15 m.eat();
16 m.travel();
17 }
18}
1/* File name : Animal.java */
2package animals;
3interface Animal {
4 public void eat();
5 public void travel();
6}