|
|
Re: Basic variable issue
|
Posted: Apr 6, 2010 12:53 AM
|
|
Is the String that you're passing in, in quotes? i.e. makeBooking("fred", 2);
I'm guessing that you've actually written... makeBooking(fred, 2);
In the latter case, the compiler thinks that fred is a variable that holds the actual name that you want to pass in. Other arguments (i.e. numbers) don't require quotes because - for them - it's obvious when you're talking about a value and when you're talking about a varible holding a value.
Alternatively, you could write: String fred = "Joe";
makeBooking(fred, 2);
But that's probably just going to confuse things.
Vince.
|
|