aspose 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
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Reply 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: 3056
    
    1

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
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://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Inner Class cannot have static method ?
 
Similar Threads
Nested/Inner classes Example program
Inner Class Doubt
more about nested class topics
accessing shadowed final values in method local inner class
doubt in InnerClass