This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
Well, it's usually only necessary to load a class once in a given JVM. So it's possible that executing code will refer to class A, causeing it to be loaded, and then later on the code refers to B, causing it to be loaded. Since A was already loaded (by itself), it will not be reloaded just before B is loaded. So: you can guarantee that a static initializer in A will run sometime before a static initializer in B - but it's hard to say exactly when. (Unless you follow exactly what code is getting executed.) And when A is loaded the first time, you have no real way of knowing if it's getting loaded just because B is getting loaded, or for some other reason. So there's not really an equivalent of getClass() that you can use to figure out what's going on. [ May 10, 2005: Message edited by: Jim Yingst ]
"I'm not back." - Bill Harding, Twister
subject: Can superclass object find the subclass type that is the true type of instance?