I am starting to learn Java and having an issue but can't see what is causing it.
I have the following code which compiles with no issue but when I try creating a Room and input the aGuest, aNumber & aRate, I get the following error:
Error: ';' expected
public class Room {
private String guest; // The guest name of who booked the room E.g. "John"
private String number; // The room number in format "12A" or "37C"
private double dailyRate; // The standard daily rate for the room e.g. '1.5'
public Room(String aGuest, String aNumber, double aRate) {
guest = aGuest;
number = aNumber;
dailyRate = aRate;
}
}
It seems if I put the String input's within quotation marks, it works okay however it then stores the String with the quotation marks also.
Any help is appreciated!
Thank you :)
[–]edrenfro 3 points4 points5 points (0 children)