To start off, a Hotel has more than one Room. Depending on what you've learnt as far, you should be using an array to hold all Room instances
Room[] rooms;
Hotel() {
rooms = new Room[4];
}
or an ArrayList
List<Room> rooms;
Hotel() {
rooms = new ArrayList<Room>();
}
See also:
Update as per your comment: just check every room if it has a guest until you find a room without a guest (like as in real world!). Pseudo:
if there is no guest in room1, then use room1;
else if there is no guest in room2, then use room2;
else if there is no guest in room3, then use room3;
else if there is no guest in room4, then use room4;
else say "sorry, no rooms left!";
This is by the way easier to do in a simple loop when you use an array.
for each room, check if there is no guest in room, then use room;
if there is no room, then say "sorry, no rooms left!";
Oh, don't forget to make the guest null
when s/he leaves the room. This will make the room eligible for reuse.