We can now choose the interface of the class, through which the clients can make use of the objects of the class ApartmentOwner. Specifically, for each functionality we have to define a public method that realizes it and determine its header.
This leads us to the following skeleton for the class ApartmentOwner:
public class ApartmentOwner {
// representation of the objects of the class
private String owner;
private String[] apartments;
// public methods that realize the requested functionalities
public ApartmentOwner(String name) { ... }
public String getOwner() { ... }
public String getApartment(int slot) { ... }
public void setApartment(String address, int slot) { ... }
public int countApartments() { ... }
public void reorganizeApartments() { ... }
public String toString() { ... }
}