Short-Circuit evaluation r Consider the following boolean expression: X> y x>Z r The expression is evaluated left to right. If X, >y is true en there's no need to evaluate x>z because the whole expression will be true whether x>z is true or not r To stop the eyaluation once the result of the whole expression is known is called short-circuit evaluation r What would happen if the short-circuit evaluation is not done for llowing expression z==0||x/z>20 C 2000 McGraw-Hill Introduction to Object-Oriented Programming with Java--Wu Chapter 6-12© 2000 McGraw-Hill Introduction to Object-Oriented Programming with Java--Wu Chapter 6 - 12 Short-Circuit Evaluation Consider the following boolean expression: x > y || x > z The expression is evaluated left to right. If x > y is true, then there’s no need to evaluate x > z because the whole expression will be true whether x > z is true or not. To stop the evaluation once the result of the whole expression is known is called short-circuit evaluation. What would happen if the short-circuit evaluation is not done for the following expression? z == 0 || x / z > 20