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!
- Take some time to predict the value of each expression.
- Test your predictions by running the code in the Java Playground below.
- 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!
- Take some time to predict the value of each expression.
- Test your predictions by running the code in the Java Playground below.
- Re-write the expression using a compound operator.
- Test the new expression by running the code in the Java Playground to ensure it yields the same result.