Thursday, January 05, 2006

Inner class

(1) only inner class can be private
(2) inner class is to access outer object private fields
(3) if requires inner class at local method, then local inner class is created.
of course, local inner class can access outer class field and method local variables. To be carefull about the param passed in local method. the variable used
for local inner class should be final variable so that the variable can not be modified
as it is inited
(4) anonymous inner class does the callback event action handling nicly. It is a step further with local inner class however, it does not define object name and object constructor but using super class ActionListener
(5) static inner class is used as we do not need inner class accessing outer class

No comments: