1、本篇博客主要介绍while语句的结构
2、源码如下
class WhileDemo
{
public static void main(String[] args)
{
/*
while(条件表达式)
{
执行语句;
}
*/
int x = 1;
while(x<3);
{
System.out.println("x="+x);
x++;
}
}
}
1、本篇博客主要介绍while语句的结构
2、源码如下
class WhileDemo
{
public static void main(String[] args)
{
/*
while(条件表达式)
{
执行语句;
}
*/
int x = 1;
while(x<3);
{
System.out.println("x="+x);
x++;
}
}
}