Hi! Is de same Anonymous Inner Class and Inner Class?? Thanks.
Manfred Leonhardt
Ranch Hand
Joined: Jan 09, 2001
Posts: 1492
posted
0
Hi Jordi, No way! An anonymous class has no name. An example:
An inner class can be any class defined inside another class. An example:
Regards, Manfred.
kavita desai
Greenhorn
Joined: Jul 09, 2001
Posts: 16
posted
0
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
Anonymous
Ranch Hand
Joined: Nov 22, 2008
Posts: 18944
posted
0
Then, anonymous class is code without class??
kavita desai
Greenhorn
Joined: Jul 09, 2001
Posts: 16
posted
0
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
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.