| Author |
illegal start of expression
|
Don Williams
Greenhorn
Joined: Jun 02, 2006
Posts: 6
|
|
The following errors are what I'm getting when I compile this program. Can you help, no matter what I try, it still comes up error. Thanks C:\Sun\AppServer\jdk\bin\Temperature.java:57: illegal start of expression public double read()//<---------------------HERE^ C:\Sun\AppServer\jdk\bin\Temperature.java:162: illegal start of expression private char myScale;//<----------------------------HERE ^ 2 errors Tool completed with exit code 1
|
 |
Stan James
(instanceof Sidekick)
Ranch Hand
Joined: Jan 29, 2003
Posts: 8791
|
|
Look for mismatched curly braces real close to your error messages. Do you have an editor that can format code or identify matching (or non-matching) braces? If not, maybe the gang will recommend one. [ June 06, 2006: Message edited by: Stan James ]
|
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
|
 |
fred rosenberger
lowercase baba
Bartender
Joined: Oct 02, 2003
Posts: 9948
|
|
|
look carefully at the braces in your public boolean read() method
|
Never ascribe to malice that which can be adequately explained by stupidity.
|
 |
Rudy Rusli
Ranch Hand
Joined: Jun 01, 2006
Posts: 114
|
|
I think you have too much open curly braces in public boolean read(). Also, I think you should remove one of the curly braces at the very bottom.
|
 |
Steve Fahlbusch
Ranch Hand
Joined: Sep 18, 2000
Posts: 491
|
|
|
And no having two methods with the same name in a class that differs only by the return value - think like the compiler - what will be returned by a read()? a boolean or a double?
|
 |
Don Williams
Greenhorn
Joined: Jun 02, 2006
Posts: 6
|
|
|
Thanks for the help.
|
 |
stephen shields
Greenhorn
Joined: Jun 05, 2006
Posts: 20
|
|
well rudy rusli is correct you do have errors with your curly brases there is an extra "{" after keyboard k = new keyboard(); indent your braces and you should always be able to catch one out of place. also let the java ide insert them for you
|
 |
Stan James
(instanceof Sidekick)
Ranch Hand
Joined: Jan 29, 2003
Posts: 8791
|
|
And no having two methods with the same name in a class that differs only by the return value - think like the compiler - what will be returned by a read()? a boolean or a double?
That will be the next error. The fun never ends.
|
 |
 |
|
|
subject: illegal start of expression
|
|
|