Question 1) DataLine.Info is a static class, what does that mean exactly?
It's an inner class that in *not* bound to an instance of the outer class -- meaning that it can't access non-static members of the outer class, as there is no instance. This is used in cases where there is no need for an instance of the outer class, or if it isn't available.
Question 2) What exactly is ".class"? it's not an instance variable...
It's a special variable, that looks like an instance variable -- but obviously can't be one because the class name is not a reference variable. Just think of it as something the compiler takes care of. It is a reference to the Class object that can be used to introspect the class.
Henry [ September 22, 2007: Message edited by: Henry Wong ]
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Oh, so you're one of the (former) Sun employees responsible for muddying the waters about the definition of terms like "inner" and "nested". It would have made a lot of sense if Sun had officially adopted definitions that made inner classes and nested classes the same thing - but they didn't. By definition, a static nested class is not an inner class. Because inner classes are, by definition, not static. All classes are either top-level classes or nested classes. All nested classes are either static classes or inner classes. Any time someone refers to a static inner class, assume they mean a static nested class - but treat everything else that person says about "inner" classes with suspicion, because apparently they've rejected the official definition, and who can tell what they mean in that case.
I should note that Henry is among my favorite JavaRanchers, and I have great respect for him. But terminology is important. It's unfortunate that Sun didn't choose more logically intuitive terminology, but it's been, what, eight years or so since Sun published the Inner Classes Specification? OK, bad example, since it was so logically inconsistent and poorly-named. Seven years since they published the JLS second edition, which incorporated most of the inner classes spec while removing the self-contradictory crap. Yes, the compiler still sometimes issues error messages which were evidently written by engineers unfamiliar with the specs, but oh well.
[Tarek]: So can outer classes be static?
Outer classes can never be static. Or rather, the term "static" is irrelevant to outer classes - though I would say that outer classes are more like static nested classes than they are like inner (non-static) classes. When applied to classes, "static" is only meaningful in defining how a nested class relates to its containing class.
And why isn't the special "class" variable mentioned in the API docs?
Where should it be mentioned? It's not an attribute of any one class - it's an attribute of all classes. They could define it in every single class, but that seems wasteful. And they can't define it in Object, because it's different for every class. It's like a static field, although technically it's not a field or variable at all. Anyway, it's defined in the Java Language Specification, section 15.8.2. [ September 22, 2007: Message edited by: Jim Yingst ]
Fair enough. Sun in general has a long history of internal inconsistency on this matter, and I can well imagine that internally there were enclaves that developed a more logically self-consistent terminology than the one Sun officially chose.