:) ok here the code
import java.util.ArrayList;
import java.util.List;
public class Hotel {
private static String name;
private static String address;
static List[] floors=new...
Type: Posts; User: mihal
:) ok here the code
import java.util.ArrayList;
import java.util.List;
public class Hotel {
private static String name;
private static String address;
static List[] floors=new...
i solved the null pointer exceptions but now it seems it isnt working properly
the if statement if ((floors[i].equals(r)) was giving me null pointer so i changed it with if ((floors.equals(r)) where...
Actually no, :( i added an main method and tryed to add a room but it giving me errors
public static void main(String[]args)throws Exception{
Hotel hotel=new Hotel("Hilton","Brodway 1001");...
What if I declare the roomPerFloor1,2,3 up in the beginning and initialize them in the constructor of hotel, i assume the constructor will be called only once and maybe replace switch with if but i...
u mean ArrayList<Type> but it cannot be int, right just String and i need to cast it right?
So how do i solve this maybe add second inner for loop that counts rooms or
i solve it somehow with...
Sorry actually im trying to compare them, so i found out i have to use .equals statement so it will be if((floors[i].equals(floor)) &&(...)&&(...) think is good like this
i get it. It can be set...
I wanted to set floors[i] to floor but it giving me error
yeah i know they have no value but i do that becouse if i set them to 0 they gonna reset every time i exit the for loop, so i think i need...
ok i need to make an method that adds a room on the specific floor
on each floor there can be maxRoomPerFloor rooms
if on floor are no rooms return false on other hand return true
@param floor is...