February 2014
Beginner
1248 pages
62h 25m
English
Lines 34–46 are one statement that declares the event listener’s class, creates an object of that class and registers it as imagesJComboBox’s ItemEvent listener. This event-listener object is an instance of an anonymous inner class—a class that’s declared without a name and typically appears inside a method declaration. As with other inner classes, an anonymous inner class can access its top-level class’s members. However, an anonymous inner class has limited access to the local variables of the method in which it’s declared. Since an anonymous inner class has no name, one object of the class must be created at the point where the class is declared (starting at line 35).
Software Engineering ...
Read now
Unlock full access