Skip to Main Content
Java
book

Java

by Michael Sikora
January 2003
Beginner to intermediate content levelBeginner to intermediate
150 pages
7h 28m
English
Morgan Kaufmann
Content preview from Java
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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Java Programming

Java Programming

Poornachandra Sarang
JAVA Programming

JAVA Programming

K. Rajkumar
Java Programming

Java Programming

Hari Mohan Pandey
Java 9 for Programmers

Java 9 for Programmers

Paul J. Deitel, Harvey Deitel

Publisher Resources

ISBN: 9781558609099