Hi Jordi, you can have various inner classes. Anonymous Inner class is one of them. 1. member inner class. which a class inside a class with a name but not same as the enclosing class 2. local inner class. class inside a method, has a name. 3. anonymous inner class. does not have a name, used widely in connection with event handling. 4. you can also have an interface inside a class. hope that explains, kavita desai
Joined: Nov 22, 2008
Then, anonymous class is code without class??
Joined: Jul 09, 2001
it is rather class without a name. the comiler supplies all the necessary code. If we go by the example of anonymous class given by Manfred...in line 3, the anonymous class is created which extends Object and implements ActionListener. The compiler creates a class file for the anonymous class with the name... (supposing the name of the enclosing class is Outer) Outer$1.class. please correct me if i am wrong, kavita desai