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 Inner Class Error 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 "Inner Class Error" Watch "Inner Class Error" New topic
Author

Inner Class Error

Betty Reynolds
Ranch Hand

Joined: Feb 16, 2000
Posts: 111
Can anyone tell me why the compiler does not like the last sysout statement in the code below?
Jesper Ottosson
Ranch Hand

Joined: Mar 21, 2000
Posts: 51
because it's not enclosed in any method
Betty Reynolds
Ranch Hand

Joined: Feb 16, 2000
Posts: 111
I'm already aware that if you put the sysout statement in a block or a method that it will compile, so maybe I should rephrase the question. Are the only statements allowed outside of blocks/methods declarations and assignments? If not, what other statements are allowed?
Please disregard this post. I think I now understand the class coding constraints.
[This message has been edited by Betty Reynolds (edited March 26, 2000).]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Inner Class Error
 
Similar Threads
inner classses
Is static inner class thread safe?
inner class
Is static inner class thread safe?
Is static inner class thread safe?