
chapter concludes the basic language syntax with a discussion of sequencing,
branching, and looping. We cover conditional statements, relational and logical operators,
including bitwise operators, and iteration statements.
3.1 Conditional Statements
3.1.1 if
Statement
The if construct is used if we wish to execute a statement only if a condition is true. The basic
format of the if statement is
if (condition) {
one or more statements to be executed if condition
is true;
}
The following code fragment illustrates the if statement:
public static void main(String[] args) {
if (args.length == i){
System.out.println("Single ...