CPSC 233 Lecture Notes - Lecture 6: Operand

61 views5 pages

Document Summary

Result of a relational expression is a boolean value (true or false) Conditional operators evaluate the right operand only when needed to determine the result. Xor complement shift right with sign extension shift right with 0 fill left shift with 0 fill. Precedence determines the order of evaluation of operations in an expression. Operators at the same level are evaluated according to their associativity. Either left to right or vice versa ( ) can be used to force precedence. Table (savitch: appendix 2): (eg. ) x * y / z => (x * y) / z x + y / z => x + (y / z) (x + y) / z => forces precedence. String firstname, lastname, fullname; firstname = mickey ; lastname = mouse ; fullname = firstname + + lastname; int age = 51; System. out. println(fllname + is + age + years old );