The ans given is 1,2,3 But none of the answers are correct right?Coz method local inner class can't be declared as public,private,protected,static,as class is defined locally inside a method.Please correct me if I am wrong. Thanks Veena
"Continuous effort - not strength or intelligence - is the key to unlocking our potential."
I think you got some confusion with ordinary classes and inner classes.The ordinary class you can have no modifies other than public.In case of Inner classes u can have private, protected, public, default and static. U can refer with JLS for confirmation and plz read K&B, you will get every thing clear on this Vivek Nidhi
Veena -- You're right, method-local inner classes can't be public, protected, private or static. But looking at the code you've shown here, the inner class is outside of main(), at class scope; it's not a method-local class at all. Such a class can indeed have all these modifiers.