Let us represent the objects of the class ApartmentOwner by the following instance variables:
At this point we can write:
public class ApartmentOwner { // representation of the objects of the class private String owner; private String[] apartments; // public methods that realize the requested functionalities }