class Animal{
int a=10;
public void move() {
System.out.println("Animals move");
}
}
class Lion extends Animal{
public void move() {
System.out.println("Lion move");
}
}
class Tiger extends Animal{
public void move() {
System.out.println("Tiger move");
}
}
public class AnimalMove {
public static void main(String[] args) {
Tiger t = new Tiger();
Lion l =new Lion();
t.move();
l.move();
}
}
0 Comments