Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
SCJP2. Please Indent your code using UBB Code
SCJP2. Please Indent your code using UBB Code
Thinking is the talking of the soul with itself...-Plato
Originally posted by Jose Botella:
[QB]
Welcome to the Ranch tangi.
JLS 8.3.2.3 says that methods are not checked for forwarding referecences on fields. Also notice that in "return i=100;" the access to "i" occurs in the left hand side of an assignment. Thus the compiler should not complain even if the expression were placed in an instance field initialization code:
8.3.2.3 Restrictions on the use of Fields during Initialization
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.
There are 12 assignment operators; all are syntactically right-associative (they group right-to-left). Thus, a=b=c means a=(b=c), which assigns the value of c to b and then assigns the value of b to a.
.
.
.
At run time, the result of the assignment expression is the value of the variable after the assignment has occurred. The result of an assignment expression is not itself a variable.
SCJP2. Please Indent your code using UBB Code
Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
SCJP2. Please Indent your code using UBB Code
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime. |