|
public method
how would i go about answering the following question -
1. findVacantRoom has no parameters and returns an integer value representing the room
number of a vacant room. Remember that the getOccupier method of a Room will return
null when a room is vacant. Room zero will be occupied first, then room 1, then room
2 and so on. This method will return the first vacant room, so if rooms 0, 1, 2 and 4 are
occupied, findVacantRoom will return 3 which is the number of the first vacant room.
The method must return -1 if the hotel is full and there are no vacant rooms.
is it asking for a conditional statement?
|