For Loop Java

For Loop in Java

For Loop in Java

Syntax:

for (initialization;condition;increment/decrement)
{
……;
}

Description :

Starts the loop with the initialization expression, executes the set of statements and proceeds the increment/decrement. Process repeats until the condition fails.

Example:

for (int i=0;i<5;i++){
System.out.println(“Print 5 times”);
}

Output:

Print 5 times

Print 5 times

Print 5 times

Print 5 times

Print 5 times

Leave a Reply

Your email address will not be published. Required fields are marked *

Looking for Online Training