How to use objects created in custom classes?
For example, clients may have multiple addresses. Create a Customer object that has the Address property. Then you can have a collection (array, ArrayList, etc.) of Clients, and each Client can have a collection of Addresses.
This is suitable for many types of information, such as products in product categories, employees in departments.
It is easier to code to handle hierarchical relationships this way.
source share