August 2004
Intermediate to advanced
480 pages
9h 41m
English
Beware when using inner classes, anonymous inner classes in particular. They are the subjects of much debate within the Java community. Developers who don't like their use say they break encapsulation—one of the key principles of object-oriented programming—and that they're hard to read and difficult for beginners to understand.
Developers who promote their use during late night local television shows point to their convenience and elegance. You need to know about them to read and write Swing application code. But in general, you don't need them, and your code is probably clearer and more flexible without them.
My rule is this: Use anonymous inner classes to handle actions and events. Don't ...
Read now
Unlock full access