Hareendra Reddy wrote:I got the question from here(Qno: 14)..
The answers are given as c and d ...
I believe only d is correct and how can we can know about the nature of anonymous class??
Thanks
Dear friend..... c AND d are correct! A class created INSIDE a method (including static methods) is called METHOD-LOCAL-INNER-CLASS.
The same rules apply to LOCAL VARIABLE DECLARATIONS.
The ONLY modifiers you can use are either abstract OR final. NEVER both at the same time!!.
So c is correct! as well as d.
Try this:
Remember that I am studying
java just like you AND others, DO NOT rely on me 100%, I am NOT above mistakes. Thank you for your understanding.
Hey! After reading CAREFULLY the options I agree with you that option c is wrong!.
Here is my understanding:
1. class created inside the main method "IS" final.
2. class created inside the main method "CAN BE" final. // this sounds better.