while打印1到9的值

来源:互联网 发布:手机微信载入数据失败 编辑:程序博客网 时间:2024/04/28 03:49
public class TestWhile
{
    public static void main(String[] args)
    {
        /*
        需求:
        用while循环打印出1到9的值
        */
        int i = 1;
        while(i <= 9)
        {
            System.out.println("i="+i);
            i++;
        }
    }
}
0 0
原创粉丝点击