While---Test

package wan0730;

public class Mooc0305WhileTest {

	public static void main(String[] args) {
		// TODO 自动生成的方法存根

		System.out.println("==============While Test=============");
		int x = 10;
		while (x < 20) {
			System.out.println("value of x =" + x);
			x++;
			System.out.println("\n");
		}

		System.out.println("==============Do While Tese===============");
		x = 10;
		do {
			x++;
			if (x%2 == 0)
			{
				continue;
			}
			System.out.println("value of x =" + x);
		}while(x < 20);
	}
}

2021-08-03 10:06:19 星期二

posted @ 2021-08-03 10:06  toumaoyu  阅读(44)  评论(0)    收藏  举报