Power Your Software Testing
with AI and Cloud
Supercharge QA with AI for Faster & Smarter Software Testing

While Loop is a control flow statement that lets you execute code repeatedly until a given Boolean condition becomes true, the loop stops when the Boolean condition becomes false.
Syntax
while (condition) {
// code block to be executed
increment / decrement statement
}Example
The below Java program prints numbers from 1 to 10.
class OneToFive {
public static void main(String[] args) {
int i = 1, k = 10;
while(i <= k) {
System.out.println(i);
i++;
}
}
}
KaneAI - Testing Assistant
World’s first AI-Native E2E testing agent.

Get 100 minutes of automation test minutes FREE!!