This might seem elementary to many of you but …
when I declare a sentence like this:-
Room room = findRoom(nbBeds, date_Entrance, date_Exit);
What does room hold ? does it hold the output of findroom ?
what is this called? what should I read to understand this concept of creating a variable type class ?
your
findRoom(nbBeds, date_Entrance, date_Exit);should return an object with typeRoom.your
roomreferences that object. Note that the object can be null.if the “output” you meant in your question is the outputs (by
System.out.printfor example) to console. The outputs have nothing to do with returned value. You can output anything, but you have to return aRoomtype object. Otherwise you got compilation error on that line.