{"id":2484,"date":"2016-10-25T12:54:04","date_gmt":"2016-10-25T03:54:04","guid":{"rendered":"http:\/\/www.whoocus.com\/blog\/?p=2484"},"modified":"2016-10-25T12:54:04","modified_gmt":"2016-10-25T03:54:04","slug":"2484","status":"publish","type":"post","link":"https:\/\/www.blowfish.co.jp\/?p=2484","title":{"rendered":""},"content":{"rendered":"<p>Ruby\u3092\u5229\u7528\u3059\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3001\u300c\u9762\u5012\u81ed\u3044\u306e\u30672\u5ea6\u3068Java\u306a\u3069\u66f8\u304f\u3082\u306e\u304b\u3002\u300d\u3068\u6c7a\u3081\u3066\u304b\u3089\u3001\u65e97\uff5e8\u5e74\u3002Java8 \u306b\u8208\u5473\u3092\u6301\u3061\u59cb\u3081\u305f\u3002Ruby\u306e\u304a\u6c17\u8efd\u3055\u306b\u3001\u3061\u3087\u3063\u3068\u98fd\u304d\u305f\u611f\u304c\u3042\u308b\u3002<\/p>\n<p>\u81ea\u5206\u304c\u6700\u5f8c\u306b\u898b\u305f\u306e\u306f\u3001Java5\u3002\u8cc7\u683c\u3092\u53d6\u3063\u305f\u306e\u3082 Java1.4\u3002\u4f55\u306e\u5f79\u306b\u3082\u7acb\u305f\u306a\u304f\u306a\u3063\u3066\u3044\u308b\u3002<br \/>\n\u305d\u3053\u3067\u3001\u3061\u3087\u3063\u3068\u3057\u305f\u8208\u5473\u3067Java\u3078\u306e\u56de\u5e30\u3002<\/p>\n<p>[java]<br \/>\nimport java.util.ArrayList;<br \/>\nimport java.util.List;<\/p>\n<p>public class PrintListSample {<\/p>\n<p>\t\/**<br \/>\n\t * @param args<br \/>\n\t *\/<br \/>\n\tpublic static void main(String[] args) {<br \/>\n\t\tArrayList&lt;String&gt; list = new ArrayList&lt;&gt;();<br \/>\n\t\tlist.add(&quot;Java&quot;);<br \/>\n\t\tlist.add(&quot;Ruby&quot;);<br \/>\n\t\tlist.add(&quot;C#&quot;);<\/p>\n<p>\t\t\/\/\u53e4\u3044\u30b9\u30bf\u30a4\u30eb<br \/>\n\t\tprintListWithOldLoop(list);<\/p>\n<p>\t\t\/\/\u901a\u5e38\u30b9\u30bf\u30a4\u30eb<br \/>\n\t\tprintListWithLoop(list);<\/p>\n<p>\t\t\/\/Stream\u30b9\u30bf\u30a4\u30eb<br \/>\n\t\tprintListWithStream(list);<br \/>\n\t}<\/p>\n<p>\t\/*<br \/>\n\t * \u53e4\u3044\u30b9\u30bf\u30a4\u30eb<br \/>\n\t *\/<br \/>\n\tprivate static void printListWithOldLoop(ArrayList&lt;String&gt; list) {<br \/>\n\t\tfor(int i = 0; i &lt; list.size(); i++){<br \/>\n\t\t\tSystem.out.println(list.get(i));<br \/>\n\t\t}<br \/>\n\t}<\/p>\n<p>\t\/*<br \/>\n\t * \u901a\u5e38\u30b9\u30bf\u30a4\u30eb<br \/>\n\t *\/<br \/>\n\tprivate static void printListWithLoop(ArrayList&lt;String&gt; list) {<br \/>\n\t\tfor(String s : list){<br \/>\n\t\t\tSystem.out.println(s);<br \/>\n\t\t}<br \/>\n\t}<\/p>\n<p>\t\/*<br \/>\n\t * Stream<br \/>\n\t *\/<br \/>\n\tprivate static void printListWithStream(List&lt;String&gt; list) {<br \/>\n\t\tlist.stream().forEach(System.out::println);<br \/>\n\t}<\/p>\n<p>}<br \/>\n[\/java]<\/p>\n<p>\u3061\u306a\u307f\u306b\u3001IDE\u3092eclipse\u4f7f\u7528\u3057\u3066\u3044\u308b\u5834\u5408\u30011.8\u306b\u5bfe\u5fdc\u3057\u3066\u3044\u306a\u3044\u3068\u30a8\u30e9\u30fc\u3068\u306a\u308b\u306e\u3067\u6ce8\u610f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ruby\u3092\u5229\u7528\u3059\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3001\u300c\u9762\u5012\u81ed\u3044\u306e\u30672\u5ea6\u3068Java\u306a\u3069\u66f8\u304f\u3082\u306e\u304b\u3002\u300d\u3068\u6c7a\u3081\u3066\u304b\u3089\u3001\u65e97\uff5e8\u5e74\u3002Java8 \u306b\u8208\u5473\u3092\u6301\u3061\u59cb\u3081\u305f\u3002Ruby\u306e\u304a\u6c17\u8efd\u3055\u306b\u3001\u3061\u3087\u3063\u3068\u98fd\u304d\u305f\u611f\u304c\u3042\u308b\u3002 \u81ea\u5206\u304c\u6700\u5f8c\u306b\u898b\u305f\u306e\u306f\u3001Java5\u3002\u8cc7 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"saved_in_kubio":false,"footnotes":""},"categories":[9,4],"tags":[],"class_list":["post-2484","post","type-post","status-publish","format-standard","hentry","category-java","category-tech"],"_links":{"self":[{"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/2484","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2484"}],"version-history":[{"count":1,"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/2484\/revisions"}],"predecessor-version":[{"id":2485,"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/2484\/revisions\/2485"}],"wp:attachment":[{"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2484"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2484"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2484"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}