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
Rating: 
Average Votes: (1893)
Rate It:   
Favorites:

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:

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

[ Refresh Image ]
  

 


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