EXPRESSIONS
Evaluate Left Hand Operand First
15.6.1
A method invocation expression can also result in an exception being thrown if an
exception occurs that causes execution of the method body to complete abruptly.
A class instance creation expression can also result in an exception being thrown
if an exception occurs that causes execution of the constructor to complete
abruptly. Various linkage and virtual machine errors may also occur during the
evaluation of an expression. By their nature, such errors are difficult to predict and
difficult to handle.
If an exception occurs, then evaluation of one or more expressions may be ter 
minated before all steps of their normal mode of evaluation are complete; such
expressions are said to complete abruptly. The terms  complete normally 
and  complete abruptly  are also applied to the execution of statements ( 14.1).
A statement may complete abruptly for a variety of reasons, not just because an
exception is thrown.
If evaluation of an expression requires evaluation of a subexpression, abrupt
completion of the subexpression always causes the immediate abrupt completion
of the expression itself, with the same reason, and all succeeding steps in the nor 
mal mode of evaluation are not performed.
15.6   Evaluation Order
Let all things be done decently and in order.
 I Corinthians 14:40
Java guarantees that the operands of operators appear to be evaluated in a specific
evaluation order
, namely, from left to right.
It is recommended that Java code not rely crucially on this specification. Code
is usually clearer when each expression contains at most one side effect, as its
outermost operation, and when code does not depend on exactly which exception
arises as a consequence of the left to right evaluation of expressions.
15.6.1   Evaluate Left Hand Operand First
The left hand operand of a binary operator appears to be fully evaluated before
any part of the right hand operand is evaluated. For example, if the left hand oper 
and contains an assignment to a variable and the right hand operand contains a
reference to that same variable, then the value produced by the reference will
reflect the fact that the assignment occurred first.
305






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