Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

<identifier> expected & illegal start of expression

 
Ranch Hand
Posts: 65
Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can somebody please help me. I am new to Java and some what lost. I continue to receive <identifier> expected & illegal start of expression.
On line 21 I receive <identifier> expected
on line 36 I receive illegal start of expression
on lines 47 - 54 I receive Class, interface, or enum expected
I know it has something to do with { } but I can't seem to find the problem, would ya'll please help me. Thanks for your time and effort Danny

Here is the code

 
author
Posts: 23879
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Danny Broadwater wrote:Can somebody please help me. I am new to Java and some what lost. I continue to receive <identifier> expected & illegal start of expression.
On line 21 I receive <identifier> expected
on line 36 I receive illegal start of expression
on lines 47 - 54 I receive Class, interface, or enum expected
I know it has something to do with { } but I can't seem to find the problem, would ya'll please help me. Thanks for your time and effort Danny



Generally, when you get these types of errors, it is a good idea to only deal with the first one, and then recompile. Anyway, with the first error, the mistake starts at line 16. I believe you may be trying to create an inner class, but the syntax is wrong.

Henry
 
Danny Broadwater
Ranch Hand
Posts: 65
Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you I got the first on and the second ones fixed. Now working on the last ones 49 - 54. thanks for your time and effort. Danny
 
Marshal
Posts: 69894
278
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Illegal start may be caused by having more {s than you think.
Identifier expected might be because you have written a keyword by mistake.
Class interface or enum expected at the end of the file often means more }s than you think.
EXITONCLOSE doesn't exist. You can find what you should use in the JFrame documentation.
 
Danny Broadwater
Ranch Hand
Posts: 65
Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for your time and effort. Danny
 
No more fooling around. Read this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic