tailieunhanh - Introduction to java programming: Chapter 3 - Control Statements

Introduction to java programming: Chapter 3 - Control Statement's Objectives is to declare boolean type and write Boolean expressions; distinguish between conditional and unconditional && and operators; use Boolean expressions to control selection statements; implement selection control using if and nested if statements. | Chapter 3 Control Statements Basic computer skills such as using Windows Liang Introduction to Java Programming Sixth Edition c 2005 Pearson Education Inc. All rights reserved. 0-13Ỉ148952-6 Objectives To declare boolean type and write Boolean expressions . To distinguish between conditional and unconditional and operators . To use Boolean expressions to control selection statements . To implement selection control using if and nested if statements . To implement selection control using switch statements . To write expressions using the conditional operator . To display formatted output using the method and to format strings using the method . To know the rules governing operand evaluation order operator precedence and operator associativity . Liang Introduction to Java Programming Sixth Edition c 2005 Pearson Education Inc. All rights reserved. 0-132148952-6 The boolean Type and Operators Often in a program you need to compare two values such as whether i is greater than j. Java provides six comparison operators also known as relational operators that can be used to compare two values. The result of the comparison is a Boolean value true or false. boolean b 1 2 Liang Introduction to Java Programming Sixth Edition c 2005 Pearson Education Inc. All rights reserved. .