How to make different instances of a class?
<p>I am making a simple programm that allows people to checkin and out a hotel (for my CS class).</p>

<p>What I need to be able to do is check in a person in a room. There are four rooms. How can i make it so that when someone is checked in, the next person that checks in will check in room 2.</p>

<p>i have the following already:</p>

<p><pre><code>  class Hotel {
       class Hotel {</p>

<p>Room room1, room2, room3, room4;</p>

<pre><code>Hotel() {
    room1 = new Room();
    room2 = new Room();
    room3 = new Room();
    room4 = new Room();
}
</code></pre>

<p>}</p>

    static checkIn() {
    Scanner sc = new Scanner(System.in);
    System.out.print("naam:");
    String invoer2 = sc.nextLine();

    if (room1.guest == null) {      
    room1.guestst = invoer2;
    System.out.println("Guest " + room1.guest + " gets room 1");
    return;
    }
    else {
        System.out.println("no rom");
    }

    return;
    }                        
}

class Room {
    static int count;
    String guest;

    Room() {
        guest = null;
        count--;
    }

    Room(String newGuest) {
        guest = newGuest;
        count++;
    }
}

class Guest {
    String name;

    Guest(String newName) {
        name = newName;
    }
}
</code></pre>
