has a vs is a relationship java code example
Example 1: is a and has a relationship in java
class Apple extends Fruit {
}
Example 2: is a and has a relationship in java
class Room {
Table table = new Table();
}
class Apple extends Fruit {
}
class Room {
Table table = new Table();
}