循环语句的一些小知识点

来源:互联网 发布:蒙巴顿亲王知乎 编辑:程序博客网 时间:2024/06/13 02:37
class TestFor{public static void main(String[] args){int x=1;for(System.out.println("a");System.out.println("b");System.out.println("c")){System.out.println("d")}// this for-circle can't be compiled,because the second expression"System.out.println("b")" need to be bealean //the changed circle is rightfor(System.out.println("a");x<4;System.out.println("a")){System.out.println("d");}}}/*more about :the simplest infinite circle: for语句  for(;;){}while语句:while(true){}*/