public class PersonInfo {
protected String firstName;
protected String birthdate;
...
}
public class ChildInfo extends PersonInfo {
private String schoolName;
...
}
public class MotherInfo extends PersonInfo {
private String spousename;
private ChildInfo children1;
private ChildInfo children2;
private ChildInfo children3;
...
}
- Draw the relationships for the classes above using UML. If a class inherits from another class, draw an open arrow pointing to the base class from the derived class. If a class has another class as a variable, then draw a dashed line with an pointed arrow from the class that has the variable to the class that is used. image
- Label each arrow with the type of relationship: image
- "is-a"
- "has-a"