This is the main:
public class main { public static void main(String[] args) { Patient p1 = new Patient("Jordan"); Bed b1 = new Bed("d34"); p1.setBed(b1); System.out.println(p1); System.out.println(b1); b1.verwijderPatient(); System.out.println(p1); System.out.println(b1); b1.setPatient(p1); System.out.println(p1); System.out.println(b1); p1.verwijderBed(); System.out.println(p1); System.out.println(b1); } }
This is the first object Bed:
public class Bed { private String nummer; private Patient patient; public String toString() { return nummer +" " + patient; } public Bed(String num) { nummer = num; } public void verwijderPatient() { patient = null; } public void setPatient(Patient p) { patient = p; } }
This is the second object Patient:
public class Patient { private String naam; private Bed bed; public String toString() { return naam +" "+ bed; } public Patient(String na) { naam = na; } public void setBed(Bed b) { bed = b; } public void verwijderBed() { bed = null; } }
This is the console:
Jordan d34 null d34 null Jordan d34 null d34 null Exception in thread "main" java.lang.StackOverflowError at java.lang.AbstractStringBuilder.append(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at java.lang.StringBuilder.<init>(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Bed.toString(Bed.java:7) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at Patient.toString(Patient.java:7)
Don't understand what's wrong about it and I think the relation between bed and patient isn't quite right and I prints out null where it doesn't need to.
Any help? I would appreciate it I'm a student in Industrial Ingeneering in my first year from Belgium.
Thanks in regards.