Get the tools you need to learn Java skills fast!
Video tutorials, eBooks, hands-on lab exercises, sample code.
Get started
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 The Software Craftsman this week in the Agile 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).]
 
Have you tried LearnNowOnline? http://www.learnnowonline.com/
 
subject: Inner Class Error