wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes illegal start of expression Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "illegal start of expression" Watch "illegal start of expression" New topic
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: 11149
    
  16

look carefully at the braces in your public boolean read() method


There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
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
Bartender

Joined: Sep 18, 2000
Posts: 557
    
    7

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
 
Similar Threads
Methods: parameters
confused
comparison methods
simple dating program
compare variables of an object