EXPRESSIONS
Compound Assignment Operators
15.25.2
At run time, the expression is evaluated in one of two ways. If the left hand
operand expression is not an array access expression, then four steps are required:
First, the left hand operand is evaluated to produce a variable. If this evalua 
tion completes abruptly, then the assignment expression completes abruptly
for the same reason; the right hand operand is not evaluated and no assign 
ment occurs.
Otherwise, the value of the left hand operand is saved and then the right hand
operand is evaluated. If this evaluation completes abruptly, then the assign 
ment expression completes abruptly for the same reason and no assignment
occurs.
Otherwise, the saved value of the left hand variable and the value of the right 
hand operand are used to perform the binary operation indicated by the com 
pound assignment operator. If this operation completes abruptly (the only
possibility is an integer division by zero see  15.16.2), then the assignment
expression completes abruptly for the same reason and no assignment occurs.
Otherwise, the result of the binary operation is converted to the type of the
left hand variable and the result of the conversion is stored into the variable.
If the left hand operand expression is an array access expression ( 15.12), then
many steps are required:
First, the array reference subexpression of the left hand operand array access
expression is evaluated. If this evaluation completes abruptly, then the assign 
ment expression completes abruptly for the same reason; the index subexpres 
sion (of the left hand operand array access expression) and the right hand
operand are not evaluated and no assignment occurs.
Otherwise, the index subexpression of the left hand operand array access
expression is evaluated. If this evaluation completes abruptly, then the assign 
ment expression completes abruptly for the same reason and the right hand
operand is not evaluated and no assignment occurs.
Otherwise, if the value of the array reference subexpression is
null
, then no
assignment occurs and a
NullPointerException
is thrown.
Otherwise, the value of the array reference subexpression indeed refers to an
array. If the value of the index subexpression is less than zero, or greater
than or equal to the length of the array, then no assignment occurs and an
IndexOutOfBoundsException
is thrown.
Otherwise, the value of the index subexpression is used to select a component
of the array referred to by the value of the array reference subexpression. The
375






footer




 

 

 

 

 Home | About Us | Network | Services | Support | FAQ | Control Panel | Order Online | Sitemap | Contact

java hosting

 

Our partners: PHP: Hypertext Preprocessor Best Web Hosting Java Web Hosting Inexpensive Web Hosting  Jsp Web Hosting

Cheapest Web Hosting Jsp Hosting Cheap Hosting

Visionwebhosting.net Business web hosting division of Web Design Plus. All rights reserved