while( 布尔表达式 ) {

//循环内容

}

只要布尔表达式的值为True,循环体语句就会执行

package hello.demo;

public class hello2 {
public static void main(String[] args){
int x = 20;
while (x < 100){
System.out.println("value of x : "+x);
x++;
//System.out.println("\n");
}
}
}

相关文章:

  • 2022-12-23
  • 2021-11-14
  • 2022-12-23
  • 2021-07-27
  • 2022-12-23
  • 2021-05-16
  • 2022-01-17
猜你喜欢
  • 2021-08-23
  • 2022-02-02
  • 2022-01-06
  • 2021-10-12
  • 2022-01-02
  • 2021-05-23
  • 2022-12-23
相关资源
相似解决方案