I think I have my method set properly to give me the total number of rooms but it won't compile. Where did I go wrong?
public class Hotel {
public static int singleRooms;
public static int doubleRooms;
public static int kingRooms;
public Hotel(int numberSingleRooms, int numberDoubleRooms, int numberKingRooms) {
singleRooms = numberSingleRooms;
doubleRooms = numberDoubleRooms;
kingRooms = numberKingRooms;
}
public static Hotel IvanHotel = new Hotel(1,3,5);
int totalRooms = GetTotalRooms(IvanHotel);
public static void main(String[] args) {
System.out.println(totalRooms);
}
}
public class GetTotalRooms {
public static int totalRooms;
public int GetTotalRooms(Hotel yourHotel) {
totalRooms = Hotel.singleRooms + Hotel.doubleRooms + Hotel.kingRooms;
return totalRooms;
}
}
What should I change in order to get it to compile? I am getting a cannot find symbol error and I don't know why.