Meaningless Drivel is fun!
The moose likes Beginning Java and the fly likes Static Inner Class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Static Inner Class" Watch "Static Inner Class" New topic

Static Inner Class

Willie Toma
Ranch Hand

Joined: May 11, 2001
Posts: 78

Why do I get an error in the previous code when it is placed inside a class? "Invalid method declaration; return type required on line 4"

[This message has been edited by Willie Toma (edited December 10, 2001).]
jason adam
Chicken Farmer ()
Ranch Hand

Joined: May 08, 2001
Posts: 1932
You can't have your System.out.println() statement floating free within a class. Try putting it within a method inside your inner class, and your compilation error should go away.
I agree. Here's the link:
subject: Static Inner Class
It's not a secret anymore!