Some classes in the standard Java API are treated slightly different from other classes. I\'m talking about those classes that couldn\'t be implemented without special support f
Java array as in int[].class
Since the important classes were mentioned, I'll mention some interfaces:
The Iterable
interface (since 1.5) - it allows an object to participate in a foreach loop:
Iterable<Foo> iterable = ...;
for (Foo foo : iterable) {
}
The Serializable interface has a very special meaning, different from a standard interface. You can define methods that will be taken into account even though they are not defined in the interface (like readResolve()
). The transient
keyword is the language element that affects the behaviour of Serializable
implementors.
sun.misc.unsafe is the mother of all dirty, spirit-of-the-language-breaking hacks.
java.lang.ClassLoader, though the actual dirty work is done by some unmentioned subclass (see 12.2.1 The Loading Process).