What I want to do is to add Objects from another class(Noten) here and to print them out. I know that this is a common problem but still I can't find a solution.
private ArrayList<Noten> notes123; public void addNotes(Noten newNotes) { if (notes123.size() >= 0) { notes123.add(newNotes); System.out.println(newNotes); } else { System.out.println("No Notes."); } } public void schuelerInfo() { System.out.println("Name: " + name + " Student number: " + nummer); System.out.println("The notes are "); for (Noten note: notes123) { System.out.println(Noten.notenInfo()); } }
Noten.notenInfo()should probably benote.notenInfo()