• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

y static var r not allowed in INNER CLASSES ?

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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) ?
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
sorry ! I was not aware of the "Use real words" rule
 
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
reply
    Bookmark Topic Watch Topic
  • New Topic