Java Reference
In-Depth Information
15.8.4. Qualified
this
keyword
this
.
Let
C
be the class denoted by
ClassName
. Let
n
be an integer such that
C
is the
n
'th lexic-
ally enclosing class of the class in which the qualified
this
expression appears.
The value of an expression of the form
ClassName
.this
is the
n
'th lexically enclosing in-
stance of
this
.
The type of the expression is
C
.
It is a compile-time error if the current class is not an inner class of class
C
or
C
itself.
15.8.5. Parenthesized Expressions
A parenthesized expression is a primary expression whose type is the type of the contained
expression and whose value at run time is the value of the contained expression. If the con-
tained expression denotes a variable then the parenthesized expression also denotes that
variable.
The use of parentheses affects only the
order
of evaluation, except for a corner case
whereby
(-2147483648)
and
(-9223372036854775808L)
are legal but
- (2147483648)
and
-
(9223372036854775808L)
are illegal.
This is because the decimal literals
2147483648
and
9223372036854775808L
are allowed
only as an operand of the unary minus operator (§
3.10.1
).
In particular, the presence or absence of parentheses around an expression does not (except
for the case noted above) affect in any way:
• whether a variable is definitely assigned, definitely assigned when
true
, definitely
assigned when
false
, definitely unassigned, definitely unassigned when
true
, or def-
initely unassigned when
false
(§16).
15.9. Class Instance Creation Expressions
A class instance creation expression is used to create new objects that are instances of
classes.
ClassInstanceCreationExpression:
new
TypeArguments
opt
TypeDeclSpecifier TypeArgumentsOrDiamond
opt