---<br />Erik Weibust<br /><a href="http://erik.weibust.net" target="_blank" rel="nofollow">http://erik.weibust.net</a>
I will do the best with what God gave me!
So inner classes could never be created without outter ones.
"I'm not back." - Bill Harding, Twister
Originally posted by Marlene Miller:
(I wish someone could explain why inner classes cannot declare static members.)
[ June 27, 2003: Message edited by: Marlene Miller ]
"I'm not back." - Bill Harding, Twister
[MM]:Inner member classes differ from local classes not only by where they are declared. Inner member classes cannot be instantiated from a static context.
[JY]:This is going to confuse people; it's going to be hard to explain that "static" in this context is limited in scope to the duration of a single execution of the foo() method, and a subsequent execution creates a different "static" variable. Ugh.
"I'm not back." - Bill Harding, Twister
Originally posted by Jim Yingst:
Your toString() is changing the value of the static field just before it's printed. That's just evil.
From the Assertion Specification,
The compiler adds a synthetic field to every class that contains one or more assert statements. The synthetic field contains the complement of the actual assertion status of the class:
static final boolean $assertionsDisabled =
!<EnclosingTopLevelClassName>.class.desiredAssertionStatus();
This declaration must be placed before all other static variable declarations and static initializers in the class. The name of the field is not part of the specification: it is local to the class and can vary from implementation to implementation and class to class. This field may occur in contexts where static fields are not permitted by the Java programming language, such as inner classes; because it is a synthetic field, this does not present a problem. While the presence of such a field violates the JLS, it does not violate the JVMS.
passwords must contain 14 characters, a number, punctuation, a small bird, a bit of cheese and a tiny ad.
New web page for Paul's Rocket Mass Heaters movies
https://coderanch.com/t/785239/web-page-Paul-Rocket-Mass
|