{"type":"rich","image_url":null,"url":"https://bleis-tift.hatenablog.com/entry/20071219/1198049417","version":"1.0","categories":["Java"],"blog_url":"https://bleis-tift.hatenablog.com/","provider_url":"https://hatena.blog","author_url":"https://blog.hatena.ne.jp/bleis-tift/","width":"100%","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fbleis-tift.hatenablog.com%2Fentry%2F20071219%2F1198049417\" title=\"\u30af\u30ed\u30fc\u30b8\u30e3 - \u3050\u308b\u3050\u308b\uff5e\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","author_name":"bleis-tift","provider_name":"Hatena Blog","published":"2007-12-19 16:30:17","blog_title":"\u3050\u308b\u3050\u308b\uff5e","height":"190","title":"\u30af\u30ed\u30fc\u30b8\u30e3","description":"JavaSE\u3067\u5165\u308b\u3068\u304b\u5165\u3089\u306a\u3044\u3068\u304b\u542b\u3081\u307e\u3060\u63fa\u308c\u305d\u3046\u306a\u30af\u30ed\u30fc\u30b8\u30e3\u3060\u3051\u3069\u3001\u500b\u4eba\u7684\u306bBGGA\u306e public static <V> void for each(Iterable<V> collection, { V => void } block) { for (V v : collection) block(v); } \u304c\u6c17\u306b\u5165\u3063\u3066\u3044\u308b\u3002 each\u30e1\u30bd\u30c3\u30c9\u306f\u30b8\u30a7\u30cd\u30ea\u30c3\u30af\u30e1\u30bd\u30c3\u30c9\u3067\u3001\u7b2c\u4e8c\u5f15\u6570\u306bV\u3092\u53d7\u3051\u53d6\u308a\u623b\u308a\u5024\u304c\u306a\u3044\u30af\u30ed\u30fc\u30b8\u30e3\u3092\u53d7\u3051\u53d6\u308b\u3002 \u3067\u3001\u3053\u308c\u306e\u4f7f\u3044\u65b9\u306f int[] ls = {1,2,3,4,5}; int total = 0; for each(int i : ls) total += i;\u2026"}