abstract class Animal{
public abstract void talk();
}
class Cat extends Animal{
public void talk(){
System.out.println("miawww,miawwww");
}
}
class Dog extends Animal{
public void talk(){
System.out.println("woof,woof");
}
}
class Mysoft{
public static void getVoice(Animal a)
{
a.talk();
}
}
class Main{
public static void main(String[] args) {
Cat c= new Cat();
Dog d=new Dog();
Mysoft.getVoice(c);
}
}
public abstract void talk();
}
class Cat extends Animal{
public void talk(){
System.out.println("miawww,miawwww");
}
}
class Dog extends Animal{
public void talk(){
System.out.println("woof,woof");
}
}
class Mysoft{
public static void getVoice(Animal a)
{
a.talk();
}
}
class Main{
public static void main(String[] args) {
Cat c= new Cat();
Dog d=new Dog();
Mysoft.getVoice(c);
}
}