Classes that have implemented Animal Interface

master
Hammy 4 years ago
parent afb4f4b507
commit 2c2717cfff

@ -0,0 +1,18 @@
public class Cat implements Animal {
@Override
public String animalName() {
return "Cat";
}
@Override
public String animalSound() {
return "Meoooww";
}
@Override
public double animalPrice() {
return 29.99;
}
}

@ -0,0 +1,18 @@
public class Cow implements Animal {
@Override
public String animalName() {
return "Cow";
}
@Override
public String animalSound() {
return "Moooo";
}
@Override
public double animalPrice() {
return 10.99;
}
}

@ -0,0 +1,18 @@
public class Dog implements Animal {
@Override
public String animalName() {
return "Dog";
}
@Override
public String animalSound() {
return "Woof Woof";
}
@Override
public double animalPrice() {
return 15.99;
}
}

@ -0,0 +1,18 @@
public class Horse implements Animal {
@Override
public String animalName() {
return "Horse";
}
@Override
public String animalSound() {
return "Neighh";
}
@Override
public double animalPrice() {
return 59.99;
}
}
Loading…
Cancel
Save