输出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+" ");

}


}
}

原文地址:https://www.cnblogs.com/tantanba/p/6274449.html