Java拡張for文

Twitter ツイート Hatena Bookmark ブックマーク

そんなのもあったなーとか思ってて、要はfor eachじゃね?とかおもったり思わなかったり。
あまり詳しくわかっていなかったので、サンプルソースコード書いておきます。

1
2
3
4
5
6
7
8
9
class Hello {
	public static void main(String args[])
	{
		int [] a = {1,2,3};
		for(int b : a){
			System.out.println(b);
		}
	}
}
comments powered by Disqus
Built with Hugo
テーマ StackJimmy によって設計されています。