posted 23 years ago
Hi,
The correct answer is 'B'.
Here are the points to remember.
1.An anonymous class is one that has no name.
So you cannot create an anonymous class by " new xxx(); "
[ Only if a class has a name, for example class A, you can create an instance by " A a1 = new A(); " ]
2.An Anonymous class is always Instantiated and declared in the same place.
syntax: new X() { }
3.Since an anonymous class does not have a name, it cannot have Constructor also. ( A Constructor should have the same name as that of the class in which it is defined ).
- Suresh Selvaraj
Suresh Selvaraj, (author of JQuiz)<br />SCJP2<br /><a href="http://www.decontconsulting.com" target="_blank" rel="nofollow">www.decontconsulting.com</a>