Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.ArrayList;
- import java.util.List;
- public class Room {
- private List<Bed> beds = new ArrayList<Bed>();
- private boolean vacant = true;
- public int getNumberOfBeds(){
- return beds.size();
- }
- public Bed getBed(int index){
- return beds.get(index);
- }
- public void addBed(String bedSize){
- beds.add(new Bed(bedSize));
- }
- public boolean getVacancy(){
- return vacant;
- }
- public void setVacancy(boolean vacant){
- this.vacant = vacant;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement