This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
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

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’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: Static Inner Class
It's not a secret anymore!