Lab#SE00-4: Abstract/Interface Human
Java SE Lab 00
📘 Linux Lab#SE00-4: Abstract/Interface Human
Implement this UML and its classes.
Create a @Test and a method for each class:
Person
Animal
Teacher
Student
Dog
Cat
1 Basic UML
The interfaces HumanAction
and Action
define a set of methods or properties that classes must implement.
The class Person
implements both interfaces and provides implementation for the methods defined in both HumanAction
and Action
.
Animal
class implements Action
interface and provides its own implementation for the methods defined in the interface.
Here is an example of a UML diagram that shows the relationship between the interfaces HumanAction
and Action
and the classes Person
, Teacher
, Student
, Animal
, Dog
and Cat
.
This UML diagram illustrates that the classes Person, Teacher, Student, Animals, Dog, Cat all implement the methods defined in HumanAction
and Action
It also show the Inheritance relationship between classes and implementation relationship between classes and interfaces
.
Teacher
and Student
classes inherit from Person
class and add their own specific behavior/ methods.
Dog
and Cat
classes inherit from Animal
class and add their own specific behavior/ methods.