Author | Topic: Anonymous Class |
Dadi unregistered |
posted March 04, 2000 08:28 PM
Question Which of the following statements are true? 1) An anonymous class cannot have any constructors Answer 1) An anonymous class cannot have any constructors I think 1 & 2 should be the correct answers.
|
maha anna bartender |
posted March 04, 2000 09:28 PM
Only ans 1 is correct. An anonymous class can be defined in static/instance floating blocks also. regds maha anna
[This message has been edited by Tony Alicea (edited March 05, 2000).]
|
Tony Alicea sheriff |
posted March 05, 2000 07:20 AM
About (2): A constructor is not a method and it can have anonymous classes declared in it.
|
Dadi unregistered |
posted March 05, 2000 08:55 AM
Thanks Anna & Tony !
|
Jim Yingst sheriff |
posted March 05, 2000 11:12 AM
An anonymous class can also be created when initializing a class or instance variable.
|
| | |