Static Members in Inner Classes? The Answer
Join the DZone community and get the full member experience.Join For Free
i asked a question a few days ago , regarding static members in inner classes. i presented an example with two static members, one was integer the other object type, the integer compiled correctly and the object did not. here's how it looks like in the ide:
inner classes may not declare static members, unless they are compile-time constant fields
by the way, if the class was a static nested class, rather than an inner-class, there wouldn't be any problem defining static members. plus, constants are inherited when using extensions. this means that the following is legit:
Opinions expressed by DZone contributors are their own.