{"id":992,"date":"2019-10-29T10:26:06","date_gmt":"2019-10-29T01:26:06","guid":{"rendered":"https:\/\/took.jp\/?p=992"},"modified":"2020-06-15T15:09:49","modified_gmt":"2020-06-15T06:09:49","slug":"post-992","status":"publish","type":"post","link":"https:\/\/took.jp\/tech-blog\/post-992\/","title":{"rendered":"\u3010Java\u3011 \u914d\u5217\u578b\u3068\u30ea\u30b9\u30c8\u578b\u306e\u9055\u3044\u3092\u6bd4\u8f03\u3059\u308b"},"content":{"rendered":"<p>\u3053\u306e\u8a18\u4e8b\u306e\u5185\u5bb9\u306f\u3001\u79c1\u304c\u904e\u53bb\u306b(Java\u3092\u89e6\u3063\u3066\u3044\u305f\u9803)\u8abf\u3079\u307e\u3068\u3081\u3066\u3044\u305f\u5185\u5bb9\u306a\u306e\u3067\u3001<\/p>\n<p>\u3082\u3057\u304b\u3057\u305f\u3089\u3001\u5185\u5bb9\u306b\u5c11\u3057\u304a\u304b\u3057\u306a\u3068\u3053\u308d\u3082\u3042\u308b\u304b\u3082\u3057\u308c\u306a\u3044\u3067\u3059\u304c\u3001<\/p>\n<p>\u3088\u304f\u307e\u3068\u3081\u3089\u308c\u3066\u3044\u305f\u306e\u3067\u516c\u958b\u3057\u307e\u3059\u3002\uff08\u81ea\u753b\u81ea\u8cdb\uff09<\/p>\n<p>&nbsp;<\/p>\n<h2>\u5b9a\u7fa9\u65b9\u6cd5<\/h2>\n<p><strong>\u914d\u5217\u3000<\/strong><\/p>\n<p>String sample[] = { \u201c1\u201d ,\u201d2\u201d ,\u201d3\u201d ,\u201d4\u201d ,\u201d5\" };<br \/>\nString sample[] = new String[5];<\/p>\n<p>&nbsp;<\/p>\n<p><strong>ArrayList<\/strong><\/p>\n<p>ArrayList List&lt;String&gt; sample = new ArrayList&lt;&gt;(Arrays.asList(\u201c1\u201d ,\u201d2\u201d ,\u201d3\u201d ,\u201d4\u201d ,\u201d5\"));<br \/>\nList&lt;String&gt; sample = new ArrayList&lt;String&gt;;<\/p>\n<p>&nbsp;<\/p>\n<h2>\u8981\u7d20\u6570\u304c\u6c7a\u307e\u3063\u3066\u3044\u308b\u304b<\/h2>\n<p>\u914d\u5217\u306e\u5834\u5408\u306f\u8981\u7d20\u6570\u3092\u3042\u3089\u304b\u3058\u3081\u6c7a\u3081\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u3044\u305f\u3081\u3001\u8981\u7d20\u6570\u304c\u308f\u304b\u3063\u3066\u3044\u308b\u5834\u5408\u306b\u5229\u7528\u3059\u308b\u3002<\/p>\n<p>\u305d\u308c\u306b\u6bd4\u3079\u3001ArrayList\u306e\u5834\u5408\u3001\u8981\u7d20\u306e\u8ffd\u52a0\u3084\u524a\u9664\u304c\u81ea\u7531\u306b\u884c\u3048\u6271\u3044\u3084\u3059\u3044\u3002<\/p>\n<p>\uff08 Arrays.asList\u306e\u5834\u5408\u306f\u3001\u5168\u304f\u306e\u5225\u7269\u306e\u305f\u3081\u8981\u7d20\u306e\u8ffd\u52a0\u3082\u524a\u9664\u3082\u884c\u3048\u306a\u3044\u3002\uff08\u5909\u66f4\u306f\u53ef\uff09 \uff09<\/p>\n<p>&nbsp;<\/p>\n<h2>\u51e6\u7406\u901f\u5ea6\u3092\u6bd4\u8f03<\/h2>\n<p><img decoding=\"async\" class=\"alignnone wp-image-995\" src=\"https:\/\/took.jp\/wp-content\/uploads\/2019\/10\/listarray.png\" alt=\"\" width=\"336\" height=\"244\" \/><\/p>\n<p>https:\/\/yujisoftware.hatenablog.com\/entry\/20090928\/1254154372\u3092\u53c2\u8003\u306b\u51e6\u7406\u901f\u5ea6\u306e\u6bd4\u8f03\u3092\u884c\u3063\u305f\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u914d\u5217\u306e\u65b9\u304c\u82e5\u5e72\u51e6\u7406\u901f\u5ea6\u306f\u901f\u3044\u305f\u3081\u3001\u8981\u7d20\u6570\u304c\u6c7a\u307e\u3063\u3066\u3044\u308b\u5834\u5408\u306f\u914d\u5217\u306e\u304c\u3044\u3044\u304b\u3082<\/p>\n<p><strong>\u8981\u7d20\u3078\u30a2\u30af\u30bb\u30b9\u3059\u308b\u969b\u306e\u901f\u5ea6<\/strong><\/p>\n<p>\u914d\u5217\u306e\u5834\u5408\u306f\u3001\u6307\u5b9a\u3057\u305f\u6dfb\u5b57\u6570\u306b\u76f4\u63a5\u98db\u3093\u3067\u3044\u304f\u306e\u306b\u5bfe\u3057\u3001\u30ea\u30b9\u30c8\u306e\u5834\u5408\u306f\u5148\u982d\u304b\u3089\u9806\u756a\u306b\u4e00\u81f4\u3059\u308b\u5834\u6240\u3092\u63a2\u3059\u305f\u3081\u3001\u30a2\u30af\u30bb\u30b9\u306b\u6642\u9593\u304c\u304b\u304b\u3063\u3066\u3057\u307e\u3046\u3002<\/p>\n<p><strong>\u8981\u7d20\u306e\u633f\u5165\u3001\u524a\u9664<\/strong><\/p>\n<p>\u914d\u5217\u3067\u8981\u7d20\u3092\u9014\u4e2d\u306b\u633f\u5165\u3001\u524a\u9664\u3059\u308b\u5834\u5408\u3001\u5143\u3042\u3063\u305f\u8981\u7d20\u306e\u5834\u6240\u3092\u305a\u3089\u3059\u5fc5\u8981\u304c\u3042\u308b\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u30a4\u30e1\u30fc\u30b8\u56f3<\/p>\n<table style=\"height: 32px;\" width=\"473\">\n<tbody>\n<tr style=\"height: 32px;\">\n<td style=\"height: 32px; width: 586.4px;\">\u3000\u3042\u3000\u3044\u3000\u3046\u3000\u3000\u3000\u3000\u2192\u3048\u3000\u2192\u304a<br \/>\n\u2191\u304b\uff08\u633f\u5165\uff09<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u30ea\u30b9\u30c8\u306e\u5834\u5408\u306f\u3001\u8981\u7d20\u306e\u633f\u5165\u3084\u524a\u9664\u3092\u3057\u305f\u969b\u3001\u524d\u3078\u3068\u81ea\u52d5\u7684\u306b\u914d\u5217\u306e\u8981\u7d20\u304c\u305a\u308c\u3066\u304f\u308c\u308b\u305f\u3081\u3001\u4fbf\u5229\u3002<\/p>\n<p>&nbsp;<\/p>\n<p><strong>System.out.print\u3057\u3066\u307f\u308b<\/strong><\/p>\n<p>\u914d\u5217\u306e\u5834\u5408\u306f\u305d\u306e\u307e\u307e\u3060\u3068\u30cf\u30c3\u30b7\u30e5\u30b3\u30fc\u30c9\u304c\u8868\u793a\u3055\u308c\u3066\u3057\u307e\u3046\u305f\u3081\u3001Arrays.toString(\u914d\u5217\u540d)\u3092\u4f7f\u3063\u3066\u4e00\u5ea6\u5909\u63db\u3057\u3066\u3084\u308b\u5fc5\u8981\u304c\u3042\u308b\u3002<br \/>\n\u307e\u305f\u3001\u30bb\u30c3\u30b7\u30e7\u30f3\u306b\u5165\u308c\u305f\u5834\u5408\u3001\u53d6\u308a\u51fa\u3059\u3068\u304d\u306f\u4ee5\u4e0b\u306e\u624b\u9806\u3067\u53d6\u308a\u51fa\u3059\uff08\u914d\u5217\uff09<\/p>\n<p>String A[] = (String[])session.get(\u914d\u5217\u3092\u30d7\u30c3\u30c8\u3057\u305f\u30bb\u30c3\u30b7\u30e7\u30f3\u540d);<br \/>\nString B = Arrays.toString(A);<br \/>\nSystem.out.print(B);<br \/>\nasList\u306b\u3064\u3044\u3066\u3082\u4ed5\u69d8\u306fArrayList\u3068\u4e00\u7dd2<\/p>\n<p>&nbsp;<\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-996\" src=\"https:\/\/took.jp\/wp-content\/uploads\/2019\/10\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2018-10-08-17.51.06-300x134.png\" alt=\"\" width=\"481\" height=\"215\" srcset=\"https:\/\/took.jp\/tech-blog\/wp-content\/uploads\/2019\/10\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2018-10-08-17.51.06-300x134.png 300w, https:\/\/took.jp\/tech-blog\/wp-content\/uploads\/2019\/10\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2018-10-08-17.51.06.png 532w\" sizes=\"(max-width: 481px) 100vw, 481px\" \/><\/p>\n<p>&nbsp;<\/p>\n<h2>\u7d50\u8ad6<\/h2>\n<p>\u3042\u3089\u304b\u3058\u3081\u914d\u5217\u6570\u304c\u6c7a\u307e\u3063\u3066\u3044\u308b\u5834\u5408\u306f\u3001\u914d\u5217\u3092\u4f7f\u3063\u305f\u65b9\u304c\u3001\u51e6\u7406\u901f\u5ea6\u304c\u308f\u305a\u304b\u306b\u901f\u3044\u3002<\/p>\n<p>\u3057\u304b\u3057\u3001\u30ea\u30b9\u30c8\u306e\u65b9\u304c\u5229\u7528\u3057\u3084\u3059\u304f\u3001\u51e6\u7406\u901f\u5ea6\u306b\u5927\u304d\u306a\u5dee\u306f\u306a\u3044\u305f\u3081\u3001\u7279\u6b8a\u306a\u5834\u5408\uff08\u8981\u7d20\u6570\u306e\u524a\u9664\u306b\u3088\u308b\u305a\u308c\u7b49\uff09\u4ee5\u5916\u306f\u30ea\u30b9\u30c8\u3092\u4f7f\u7528\u3057\u305f\u65b9\u304c\u826f\u3044\u304b\u3082\u3057\u308c\u306a\u3044\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u306e\u8a18\u4e8b\u306e\u5185\u5bb9\u306f\u3001\u79c1\u304c\u904e\u53bb\u306b(Java\u3092\u89e6\u3063\u3066\u3044\u305f\u9803)\u8abf\u3079\u307e\u3068\u3081\u3066\u3044\u305f\u5185\u5bb9\u306a\u306e\u3067\u3001 \u3082\u3057\u304b\u3057\u305f\u3089\u3001\u5185\u5bb9\u306b\u5c11\u3057\u304a\u304b\u3057\u306a\u3068\u3053\u308d\u3082\u3042\u308b\u304b\u3082\u3057\u308c\u306a\u3044\u3067\u3059\u304c\u3001 \u3088\u304f\u307e\u3068\u3081\u3089\u308c\u3066\u3044\u305f\u306e\u3067\u516c\u958b\u3057\u307e\u3059\u3002\uff08\u81ea\u753b\u81ea\u8cdb\uff09 &nbsp; \u5b9a\u7fa9\u65b9\u6cd5 \u914d\u5217\u3000 Stri\u2026<\/p>\n","protected":false},"author":3,"featured_media":1898,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[62,70],"tags":[],"class_list":["post-992","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-it","category-java"],"_links":{"self":[{"href":"https:\/\/took.jp\/tech-blog\/wp-json\/wp\/v2\/posts\/992","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/took.jp\/tech-blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/took.jp\/tech-blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/took.jp\/tech-blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/took.jp\/tech-blog\/wp-json\/wp\/v2\/comments?post=992"}],"version-history":[{"count":0,"href":"https:\/\/took.jp\/tech-blog\/wp-json\/wp\/v2\/posts\/992\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/took.jp\/tech-blog\/wp-json\/wp\/v2\/media\/1898"}],"wp:attachment":[{"href":"https:\/\/took.jp\/tech-blog\/wp-json\/wp\/v2\/media?parent=992"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/took.jp\/tech-blog\/wp-json\/wp\/v2\/categories?post=992"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/took.jp\/tech-blog\/wp-json\/wp\/v2\/tags?post=992"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}