Hi All,
I am using .getDeclaredClasses() method to retrieve all the classes that have been defined in object. However, I am not able to retrieve anonymous classes defined in the class. Here is the code sample that I am testing:
public class TempCodes
{
public static void main(String[] args)
{
Ball b = new Ball()
{
public void hit()
{
System.out.println("You hit it!");
}
};
b.hit();
}
interface Ball {
void hit();
}
}
and this is what my code does:
memClass = className.getDeclaredClasses();
if (memClass .length > 0)
{
for (int index = 0 ; index < memClass .length ; index++)
{
System.out.println("\t\t\t" + memClass [index]);
}
}
Can anyone help me understand how to retrieve the anonymous class?
Regards, darkie