From 2c2717cfffe8a741fd27024f855186556fe2265e Mon Sep 17 00:00:00 2001 From: Hammy Date: Sun, 11 Oct 2020 06:52:57 +0100 Subject: [PATCH] Classes that have implemented Animal Interface --- Personal/Interfaces/Animals/Cat.java | 18 ++++++++++++++++++ Personal/Interfaces/Animals/Cow.java | 18 ++++++++++++++++++ Personal/Interfaces/Animals/Dog.java | 18 ++++++++++++++++++ Personal/Interfaces/Animals/Horse.java | 18 ++++++++++++++++++ 4 files changed, 72 insertions(+) create mode 100644 Personal/Interfaces/Animals/Cat.java create mode 100644 Personal/Interfaces/Animals/Cow.java create mode 100644 Personal/Interfaces/Animals/Dog.java create mode 100644 Personal/Interfaces/Animals/Horse.java diff --git a/Personal/Interfaces/Animals/Cat.java b/Personal/Interfaces/Animals/Cat.java new file mode 100644 index 0000000..deaa84e --- /dev/null +++ b/Personal/Interfaces/Animals/Cat.java @@ -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; + } + +} diff --git a/Personal/Interfaces/Animals/Cow.java b/Personal/Interfaces/Animals/Cow.java new file mode 100644 index 0000000..7434a55 --- /dev/null +++ b/Personal/Interfaces/Animals/Cow.java @@ -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; + } + +} diff --git a/Personal/Interfaces/Animals/Dog.java b/Personal/Interfaces/Animals/Dog.java new file mode 100644 index 0000000..f881c6f --- /dev/null +++ b/Personal/Interfaces/Animals/Dog.java @@ -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; + } + +} diff --git a/Personal/Interfaces/Animals/Horse.java b/Personal/Interfaces/Animals/Horse.java new file mode 100644 index 0000000..ef94292 --- /dev/null +++ b/Personal/Interfaces/Animals/Horse.java @@ -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; + } + +} \ No newline at end of file