Test 写道
public class Test {
public static void main(String[] args) {
for(int i=0;i<5;System.out.println("the number"+(i++))){
System.out.println(i);
}
}
}
结果: 写道
0
the number0
1
the number1
2
the number2
3
the number3
4
the number4
System.out.println("")平时都用作打印,在控制台输出,没想到还能这么用,可以作为一个条件!