File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Inner Class cannot have static method ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Inner Class cannot have static method ?" Watch "Inner Class cannot have static method ?" New topic
Author

Inner Class cannot have static method ?

Saibabaa Pragada
Ranch Hand

Joined: Oct 24, 2010
Posts: 162
Hi, Please advice why inner class cannot have static method.
Stephan van Hulst
Bartender

Joined: Sep 20, 2010
Posts: 3605
    
  14

What would be the point?

Inner classes exist only to perform some sort of helper function for the enclosing class. If you're going to give them static methods, you might as well give the static methods directly to the enclosing class.
Prasad Kharkar
Ranch Hand

Joined: Mar 07, 2010
Posts: 438

I had done a small program regarding the inheritance and the static field declaration in inner classes
hope this is little useful to you


SCJP 6 [86%] June 30th, 2010
OCPWCD [84%] March 26th, 2013
If you find any post useful, click the "plus one" sign on the right
Saibabaa Pragada
Ranch Hand

Joined: Oct 24, 2010
Posts: 162
Thanks Stephan & Prasad
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Inner Class cannot have static method ?
 
Similar Threads
doubt in InnerClass
Nested/Inner classes Example program
Inner Class Doubt
accessing shadowed final values in method local inner class
more about nested class topics