This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Inner Class cannot have static method ?

 
Saibabaa Pragada
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Please advice why inner class cannot have static method.
 
Stephan van Hulst
Bartender
Pie
Posts: 5404
52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 446
1
Eclipse IDE MySQL Database Tomcat Server
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I had done a small program regarding the inheritance and the static field declaration in inner classes
hope this is little useful to you
 
Saibabaa Pragada
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Stephan & Prasad
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic