The declaration of a member needs to appear before it is used only if the member is an instance (respectively static) field of a class or interface C and all of the following conditions hold:
* The usage occurs in an instance (respectively static) variable initializer of C or in an instance (respectively static) initializer of C.
* The usage is not on the left hand side of an assignment.
* C is the innermost class or interface enclosing the usage.
can anyone explain me the last line.......does it mean
is allowed ......but when it cant be allowed? what am i missing here?
Please be more specific in your question there is not interfaces in this program and no variable or class name C.Please make your question more clear.
Joined: Sep 06, 2009
but there is an inner class.....i codunt udnerstand the last point
Joined: Jul 09, 2009
Hi Ankur ,
What I meant to say there is nothing as C in this program......
This is a program of Outer class and Inner class.In case of Inner class it can access private,protected ,default and public or any access modifier variable in inner class and declaring int y can take in that particular x variable of the outer class.