• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

y static var r not allowed in INNER CLASSES ?

 
priyaj jaydeep
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
could anyone pls tell me why static variables are not allowed in Inner classes (which are not static themselves) ?
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24212
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think there is any strong rationale besides that they're not really needed. It's possible that disallowing them made implementing the compiler a bit easier. In any case, there's really no case in which you can't simply place the static in the enclosing class for the exact same effect.

You may also find some useful info here.
[ October 20, 2005: Message edited by: Ernest Friedman-Hill ]
 
priyaj jaydeep
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry ! I was not aware of the "Use real words" rule
 
Layne Lund
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by priyaj jaydeep:
sorry ! I was not aware of the "Use real words" rule


I don't know if this is a strict rule. It's more part of the etiquette of the Internet (i.e. netiquette). Since this is a technical, and somewhat professional forum, you will be taken more seriously if you use correct English, especially typing out words instead of using IM-style abbreviations. It will also help our international audience to understand more clearly.

Thank you,

Layne
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic