Hello! I'm new to programming and I'm trying to do a basic hotel application using threads in java. Here is what i've already done:
//room class
public class Room {
private int idRoom;
private int etaj;
private boolean empty;
public Room()
{
this.idRoom = 0;
this.etaj = 0;
this.empty = false;
}
public Room(int idRoom, int etaj, boolean empty) {
this.idRoom = idRoom;
this.etaj = etaj;
this.empty = empty;
}
public int getEtaj() {
return etaj;
}
public void setEtaj(int etaj) {
this.etaj = etaj;
}
public boolean isEmpty() {
return empty;
}
public void setEmpty(boolean empty) {
this.empty = empty;
}
public int getIdRoom() {
return idRoom;
}
public void setIdRoom(int idRoom) {
this.idRoom = idRoom;
}
//Hotel class
import java.util.ArrayList;
import java.util.Random;
public class Hotel {
private int nrOfRooms;
private ArrayList<Room> Rooms;
public Hotel(int nrOfRooms, ArrayList<Room> rooms) {
this.nrOfRooms = nrOfRooms;
Rooms = rooms;
}
public int getNrOfRooms() {
return nrOfRooms;
}
public void setNrOfRooms(int nrOfRooms) {
this.nrOfRooms = nrOfRooms;
}
public void createRoom()
{
Room room = new Room();
Rooms.add(room);
}
//Client class
public class Client {
private int idClient;
private String firstName;
private String lastName;
public Client()
{
this.idClient=0;
this.firstName = "";
this.lastName = "";
}
public Client(int idClient, String nume, String prenume) {
this.idClient = idClient;
this.firstName = nume;
this.lastName = prenume;
}
public int getIdClient() {
return idClient;
}
public void setIdClient(int idClient) {
this.idClient = idClient;
}
public String getNume() {
return firstName;
}
public void setNume(String nume) {
this.firstName = nume;
}
public String getPrenume() {
return lastName;
}
public void setPrenume(String prenume) {
this.lastName = prenume;
}
Now I want to realize methods for booking rooms and unbooking rooms, I think it's better to put this methods in an interface....i've stoped here. Plese help me to contiunue! Thanks!