Hello, I'm trying to to convert this UML diagram to java code directly, and below is my code which doesn't seem to compile anyways. I'm not very sure about how to place the optional multiplicities in, e.g. 0..* and 0..1. Thank you for your help.
public class Person{
private String name;
private Person mom;
private Person dad;
private ArrayList<Person> child;
private ArrayList<Person> friend;
private ArrayList<School> alumni;
private School current = new School();
public Person(String name, Person mom, Person dad, ArrayList<Person> child, ArrayList<Person> friend, ArrayList<School> alumi, School current){
name = this.name;
mom = this.mom;
dad = this.dad;
child = this.child;
friend = this.friend;
alumni = this.alumni;
current = this.current;
}
}
public class School{
private String name;
private ArrayList<Person> student;
public School(String name, ArrayList<Person> student){
name = this.name;
student = this.student;
}
}