📜  java代码示例中的is-a关系

📅  最后修改于: 2022-03-11 14:52:11.949000             🧑  作者: Mango

代码示例1
‘is a’ relationship is also known as inheritance. We can implement 
‘is a’ relationship or inheritance in java using extends keyword. 
The advantage of inheritance or is a relationship is reusability of code 
instead of duplicating the code.
  
Ex : 
Motor cycle is a vehicle
Car is a vehicle 
Both, car and motorcycle extends vehicle.