16.1.16 Other Expressions
If an expression is not boolean-valued and is not a conditional-operator expression
or assignment expression, the following rules apply:
- If the expression has no subexpressions, V is definitely assigned after the expression iff V is definitely assigned before the expression. This case applies to literals, simple names,
this
, super
, and null
.
- If the expression has subexpressions, V is definitely assigned after the expression iff V is definitely assigned after its rightmost immediate subexpression.
For any immediate subexpression y of an expression x, V is definitely assigned
before y iff V is definitely assigned before x or one of the following situations is
true:
- y is the right-hand operand of a binary operator and V is definitely assigned after the left-hand operand.
- x is an array reference, y is the subexpression within the brackets, and V is definitely assigned after the subexpression before the brackets.
- x is a method invocation expression for an object; y is the first argument expression in the method invocation expression; there is a subexpression whose value is an object to the left of the dot, method name, and left parenthesis of the method invocation expression; and V is definitely assigned after this subexpression.
- x is a method invocation expression or class instance creation expression; y is an argument expression, but not the first; and V is definitely assigned after the argument expression to the left of y.
- x is an class instance creation expression; y is a dimension expression, but not the first; and V is definitely assigned after the dimension expression to the left of y.