输出10以内的全部奇数 continue用法

package com.chongrui.test;

/*
*Break 是直接中止循环
*continue 只能运用在for while do ...while循环语句当中,用于让程序直接跳过后面的语句,进行下一次的循环
*return语句比较
* 输出10以内的全部奇数
*
* */


public class test {

public static void main(String[] args) {
int i = 0;
System.out.println("输出10以内的全部奇数:");
while(i<10){
i++;
if(i%2 == 0){
continue;

}

System.out.println(i+" ");

}


}
}

posted @ 2017-01-11 17:14  tantanba  阅读(1185)  评论(0编辑  收藏  举报