This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes 'identifier' & 'illegal start of type' messages??? 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 " Watch " New topic
Author

'identifier' & 'illegal start of type' messages???

James Brooks
Gunslinger
Ranch Hand

Joined: Aug 17, 2006
Posts: 165
Hi all!

Can someone please tell me why I'm getting 'illegal start of type' and '<identifier> expected' error messaged for the for-loop and the last message dialog for the below code:

Thanks!

-Patrick



Hello. My name is Inigo Montoya. You killed my father. Prepare to die.
pete stein
Bartender

Joined: Feb 23, 2007
Posts: 1561
I think that you are putting code in the class block {} when you really need to put it in a method block.

Something like this:

[ April 08, 2007: Message edited by: pete stein ]
James Brooks
Gunslinger
Ranch Hand

Joined: Aug 17, 2006
Posts: 165
Oops, yeah, silly mistake... Thanks!
 
Don't get me started about those stupid light bulbs.
 
subject: 'identifier' & 'illegal start of type' messages???
 
Similar Threads
illegal start of type
Help on testprogram and subclass please
extra credit in class but stuck on persentage rates
Java Help
Ternary operators in System.out.println()