Wednesday 24 June 2015

program in java to make software to get voice of any animal....u can exted it as ur requirement without any disturbance in mysoft method

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);

}
}

2 comments:

  1. Java today is one of the most popular digital applications in web designing & is being preferred by the layman as well as high end users for different purposes such as in flash video application, 3-D gaming, complex software development etc....
    java

    ReplyDelete
  2. Hi Rosen Rose,
    What your saying is exactly right. I agree with you.
    Java for Teens

    ReplyDelete