Learning Java
Custom Search

Previous Next

Order of Operations

When evaluating an expression, java uses rules to determine which operations to perform first when there are multiple operations in an expression, as in the examples below.

	x = 3 * a + 11 / 7;
	y = 3 * (b + 11) / 7;

The order in the operators covered in this tutorial is listed below.

      Operator   Notes
    ( ) The contents of parentheses must be processed first, starting with the innermost.
    ++    - -    ! unary operations
    *    /    % multiplication, division, modulus are done next. These are done in the order in which they appear.
    +    - addition and subtraction are done next. These 2 are taken in the order in which they appear.

Previous Next

Steps In Learning

Contact us

Copyright © 2008      N. Nelson      All Rights Reserved