This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes Java in General and the fly likes Why cant True Inner Class have static member variable Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Why cant True Inner Class have static member variable" Watch "Why cant True Inner Class have static member variable" New topic
Author

Why cant True Inner Class have static member variable

Jigar Gosar
Ranch Hand

Joined: Jul 09, 2002
Posts: 95
question is simple why?

Why cant True Inner Class have static member variable?

i hope answer is as simple.

thanks, plz feel free to reply with ur own opinion. ;-)


Regards,<br />Jigar Gosar (SCJP 1.4)<br />visit: <a href="http://jigar.org/blog" target="_blank" rel="nofollow">http://jigar.org/blog</a>
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 26496
    
  78

Jigar,
If the inner class doesn't have a name, how would you refer to the static variable?


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18670
Ah, the question was about inner classes, not necessarily anonymous classes. Nearly the same question was recently discussed here. I suggest that followup discussion should go there as well.


"I'm not back." - Bill Harding, Twister
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Why cant True Inner Class have static member variable
 
Similar Threads
inner class
Inner Class
static final member
member inner class
anonymous?