int x = 8;
while (x > 8) {
System.out.println("in the loop");
x = 10;
}
If the boolean_condition is false when the loop is first encountered,
then the body of the loop will never be executed.
public class MainClass {
public static void main(String[] argv) {
while (1== 2) {
System.out.println("here");
}
}
}
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
Unreachable code
at MainClass.main(MainClass.java:3)