Skip Top Navigation Bar

Experiment with Compound Operators

In this activity, you will make predictions regarding the outcome of given expressions. You will use the Java Playground to test your predictions.

Grab a Piece of Paper, Predict and Try!

  1. Take some time to predict the value of each expression.
  2. Test your predictions by running the code in the Java Playground below.
  3. For any expression where your prediction and the actual value differs, write an explanation of how the expression is evaluated.

Evaluate, Re-write, and Test!

  1. Take some time to predict the value of each expression.
  2. Test your predictions by running the code in the Java Playground below.
  3. Re-write the expression using a compound operator.
  4. Test the new expression by running the code in the Java Playground to ensure it yields the same result.