This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
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.