Inheritance is used for code reusability, discuss what makes difference between the has a relationship and is a relationship. List with the real life examples.
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();
}