In Java, we have two types of relationship: Is-A relationship: Whenever one class inherits another class, it is called an IS-A relationship. Has-A relationship: Whenever an instance of one class is used in another class, it is called HAS-A relationship.1 Ara 2021
Read moreHas a and IS-A relationship in oops?
An IS-A relationship is inheritance. The classes which inherit are known as sub classes or child classes. On the other hand, HAS-A relationship is composition. In OOP, IS-A relationship is completely inheritance.15 Eki 2018
Read moreHas a relation example in Java?
In Java, a Has-A relationship essentially implies that an example of one class has a reference to an occasion of another class or another occurrence of a similar class . For instance, a vehicle has a motor, a canine has a tail, etc. In Java, there is no such watchword that executes a Has-A relationship.19 Oca 2021
Read more