Scripts: Scripts: Java :: Control flow statements :: Library Article #1

Developer's Section

Using if and else if statements
By: Erobo Team Member

Hire a Developer for Related Work / Installation | $55 hr
Average Votes: (2322)
Rate It:   

Basic if and else if control flow statements for Java

There are two simple rules you have to follow to learn the basics of control flow statements for the java Programming language.

Rule 1: Enclose in parenthesis the condition.
For example:

 Code Snippet 1

int i = 0;
int y = 1;
if(i == 0)   //condition enclosed in parenthesis
   //execute statement

Rule 2: Enclose in brakets the corresponding executing statement.
For example:
 Code Snippet 2

int i = 6;
int y = 7;
if(i == 7) 
   //executing statement enclosed in brakets
   System.out.println("Hello World")

See other Scripts in Control flow statements


Submit Your Scripts:

System Message:
  • Your Java script has been sent. Please allow 48 hours for processing.

If you would like to have your Java scripts published in this section please fill out
the form below:
*Your Name or
Home Town:
*Description and Code:
*Enter Code shown
to the right:

[ Refresh Image ]


© 2018 Erobo Software, Inc. All Rights Reserved. | Read Privacy Notice | RSS