public class Xunhuan { public static void main(String[] args){ int i = 1; System.out.println("Before the loop"); int sum = 0; while(i<=100){ /*条件判断 * 1.boolean值 * 3.条件运算符*/ sum = sum + i; ++i; } System.out.println("The value of sum is "+sum); System.out.println("After the loop"); } }