Using can also use Java 8 stream API and do the same thing in one line.
If you want to print any specific property then use this syntax:
ArrayList<Room> rooms = new ArrayList<>();
rooms.forEach(room -> System.out.println(room.getName()));
OR
ArrayList<Room> rooms = new ArrayList<>();
rooms.forEach(room -> {
// here room is available
});
if you want to print all the properties of Java object then use this:
ArrayList<Room> rooms = new ArrayList<>();
rooms.forEach(System.out::println);