• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

illegal start of expression

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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


 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
lowercase baba
Posts: 13089
67
Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
look carefully at the braces in your public boolean read() method
 
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Bartender
Posts: 612
7
Mac OS X Python
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the help.
 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic