Skip to content

Instantly share code, notes, and snippets.

@valo
Created December 17, 2010 10:37
Show Gist options
  • Save valo/744760 to your computer and use it in GitHub Desktop.
Save valo/744760 to your computer and use it in GitHub Desktop.
import java.util.ArrayList;
import java.util.List;
public class School {
private List<SchoolClass> m_classes = new ArrayList<SchoolClass>();
private List<SchoolRoom> m_rooms = new ArrayList<SchoolRoom>();
public School() {
}
public void addSchoolClass(SchoolClass schoolClass) {
m_classes.add(schoolClass);
}
public void addSchoolRoom(SchoolRoom room) {
m_rooms.add(room);
}
public List<SchoolClass> getSchoolClasses() {
return m_classes;
}
public List<SchoolRoom> getSchoolRooms() {
return m_rooms;
}
public void print() {
System.out.println("School info:");
System.out.println(" Classes:");
for (SchoolClass schoolClass : m_classes) {
schoolClass.print();
}
System.out.println(" Rooms:");
for (SchoolRoom schoolRoom : m_rooms) {
schoolRoom.print();
}
}
}
@skanev
Copy link

skanev commented Dec 17, 2010

Oh, nice. Hungarian notation. Haven't seen that in a while :)

@valo
Copy link
Author

valo commented Dec 20, 2010

Hehe. Just an example for a friend for his programming homework ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment