for-loopのメモ
こういう書き方も出来るんだ。
package forloop; public class ForLoop { public static void main(String[] args) { for (int i=0,j=0;j<10;System.out.println(j),j=i,System.out.println(j)) { System.out.println("(^^)"); i++; } } }
出力結果
(^^) 0 1 (^^) 1 2 (^^) 2 3 (^^) 3 4 (^^) 4 5 (^^) 5 6 (^^) 6 7 (^^) 7 8 (^^) 8 9 (^^) 9 10