Next-Gen App & Browser
Testing Cloud

Trusted by 2 Mn+ QAs & Devs to accelerate their release cycles

Next-Gen App & Browser Testing Cloud

Write a Java program to demonstrate for loop?

A for loop is a type of control flow statement that specifies iteration. It runs a block of code or statements repeatedly until a particular condition has been satisfied.

Syntax


for(initialization; condition; increment/decrement){    
//code or statement to be executed    
}    

Code Example


The below Java program demonstrates the working of for loop and prints table of 1.


public class ForLoopEx {  
public static void main(String[] args) {    
    for(int i=1;i<=10;i++){  
        System.out.println(i);  
    }  
}  
}  

Test Your Website on 3000+ Browsers

Get 100 minutes of automation test minutes FREE!!

Test Now...

KaneAI - Testing Assistant

World’s first AI-Native E2E testing agent.

...
ShadowLT Logo

Start your journey with LambdaTest

Get 100 minutes of automation test minutes FREE!!

Signup for free