80 Introduction to Java Applications Chapter 2 (Kids web site) Step
80 Introduction to Java Applications Chapter 2 Step 1. y = 2 * 5 * 5 + 3 * 5 + 7; 2 * 5 is 10 (Leftmost multiplication) Step 2. y = 10 * 5 + 3 * 5 + 7; 10 * 5 is 50 (Leftmost multiplication) Step 3. y = 50 + 3 * 5 + 7; 3 * 5 is 15 (Multiplication before addition) Step 4. y = 50 + 15 + 7; 50 + 15 is 65 (Leftmost addition) Step 5. y = 65 + 7; 65 + 7 is 72 (Last addition) Step 6. y = 72; (Last operation place 72into y) Fig. 2.1818 Order in which a second-degree polynomial is evaluated. Fig. Standard algebraic equality or relational operator Java equality or relational operator Example of Java condition Meaning of Java condition Equality operators = == x == y xis equal to y . != x != y xis not equal to y Relational operators > > x > xis greater than y < < x < xis less than y = >= x >= y xis greater than or equal to y = <= x <= y xis less than or equal to y Fig. 2.1919 Equality and relational operators. Fig. Copyright 1992 2002 by Deitel & Associates, Inc. All Rights Reserved. 7/2/01