0% found this document useful (0 votes)
70 views1 page

If Statements

The document contains a Java program that defines a class named MyApplication with a main method. It includes a while loop that prints 'In the loop' and increments an 'amount' variable until it reaches 6, at which point the loop breaks. After each increment, it prints 'Out of the loop'.

Uploaded by

niit cts
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
70 views1 page

If Statements

The document contains a Java program that defines a class named MyApplication with a main method. It includes a while loop that prints 'In the loop' and increments an 'amount' variable until it reaches 6, at which point the loop breaks. After each increment, it prints 'Out of the loop'.

Uploaded by

niit cts
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

public class MyApplication{

public static void main(String[] args){

int amount = 0;

while (true){
System.out.println("In the loop");

if(amount == 6){
break;
}
amount++;
System.out.println("Out of the loop");

}
}
}

You might also like