{"id":1,"date":"2019-05-07T02:59:49","date_gmt":"2019-05-06T17:59:49","guid":{"rendered":"http:\/\/2019se3.satoshis.jp\/?p=1"},"modified":"2019-05-07T12:59:36","modified_gmt":"2019-05-07T03:59:36","slug":"hello-world","status":"publish","type":"post","link":"https:\/\/2019se3.satoshis.jp\/?p=1","title":{"rendered":"5\u67087\u65e5"},"content":{"rendered":"<p>\u6388\u696d\u306e\u5185\u5bb9\u3092\u8a18\u9332\u3059\u308b\u30d6\u30ed\u30b0<br \/>\n<span style=\"font-size:24pt;\">URL: http:\/\/2019se3.satoshis.jp\/<\/span><\/p>\n<p>\u30c6\u30ad\u30b9\u30c8\u306e14\u7ae0\u304b\u3089<\/p>\n<p>\u30ea\u30b9\u30c814-1<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\npackage ex;\r\n\r\npublic class Main {\r\n\r\n\tpublic static void main(String[] args) {\r\n\t\tlong start = System.currentTimeMillis();\r\n\t\t\/\/ \u3053\u3053\u3067\u4f55\u3089\u304b\u306e\u6642\u9593\u304c\u304b\u304b\u308b\u51e6\u7406\r\n\t\tlong end = System.currentTimeMillis();\r\n\t\tSystem.out.println(&quot;\u51e6\u7406\u306b\u304b\u304b\u3063\u305f\u6642\u9593\u306f\u2026&quot;\r\n\t\t\t\t+ (end - start) + &quot;\u30df\u30ea\u79d2\u3067\u3057\u305f&quot;);\r\n\t}\r\n\r\n}\r\n<\/pre>\n<p>\u524d\u56de\u306e\u7d20\u6570\u304b\u3069\u3046\u304b\u3092\u5224\u5b9a\u3059\u308b\u305f\u3081\u306eJUnit\u30c6\u30b9\u30c8 PrimeTest.java<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\npackage ex;\r\n\r\nimport static org.hamcrest.CoreMatchers.*;\r\nimport static org.junit.Assert.*;\r\n\r\nimport org.junit.jupiter.api.Test;\r\n\r\nclass PrimeTest {\r\n\r\n\t@Test\r\n\tvoid \u7d20\u6570() {\r\n\t\tPrime p = new Prime();\r\n\t\tassertThat(p.isPrime(2), is(true));\r\n\t\tassertThat(p.isPrime(3), is(true));\r\n\t\tassertThat(p.isPrime(5), is(true));\r\n\t\tassertThat(p.isPrime(7), is(true));\r\n\t\tassertThat(p.isPrime(11), is(true));\r\n\t\tassertThat(p.isPrime(13), is(true));\r\n\t\tassertThat(p.isPrime(6700417), is(true));\r\n\t\tassertThat(p.isPrime(Integer.MAX_VALUE), is(true));\r\n\t\t\/\/System.out.println(Integer.MAX_VALUE);\r\n\t}\r\n\r\n\t@Test\r\n\tvoid \u7d20\u6570\u3067\u306f\u306a\u3044() {\r\n\t\tPrime p = new Prime();\r\n\t\tassertThat(p.isPrime(4), is(false));\r\n\t\tassertThat(p.isPrime(6), is(false));\r\n\t\tassertThat(p.isPrime(8), is(false));\r\n\t\tassertThat(p.isPrime(9), is(false));\r\n\t}\r\n}\r\n<\/pre>\n<p>\u30bf\u30fc\u30b2\u30c3\u30c8\u30d7\u30ed\u30b0\u30e9\u30e0 Prime.java<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\npackage ex;\r\n\r\npublic class Prime {\r\n\r\n\tpublic boolean isPrime(int n) {\r\n\t\tif (n == 2) return true;\r\n\t\tif (n % 2 == 0) return false;\r\n\t\tfor (int i = 3; i &lt; n \/2; i+=2) {\r\n\t\t\tif (n % i == 0) return false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}\r\n\r\n}\r\n<\/pre>\n<p>\u3053\u306e\u7d20\u6570\u5224\u5b9a\u3092\u30ea\u30b9\u30c814-1\u306e\u6642\u9593\u304c\u304b\u304b\u308b\u51e6\u7406\u3068\u3057\u3066\u8ffd\u52a0\u3059\u308b\u3002<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\npackage ex;\r\n\r\npublic class Main {\r\n\r\n\tpublic static void main(String[] args) {\r\n\t\tlong start = System.currentTimeMillis();\r\n\t\t\/\/ \u3053\u3053\u3067\u4f55\u3089\u304b\u306e\u6642\u9593\u304c\u304b\u304b\u308b\u51e6\u7406\r\n\t\tPrime p = new Prime();\r\n\t\tboolean b = p.isPrime(Integer.MAX_VALUE);\r\n\t\tSystem.out.println(Integer.MAX_VALUE\r\n\t\t\t\t+ &quot;\u306e\u7d20\u6570\u5224\u5b9a\u7d50\u679c\u306f&quot; + b + &quot;\u3067\u3059&quot;);\r\n\t\tlong end = System.currentTimeMillis();\r\n\t\tSystem.out.println(&quot;\u51e6\u7406\u306b\u304b\u304b\u3063\u305f\u6642\u9593\u306f\u2026&quot;\r\n\t\t\t\t+ (end - start) + &quot;\u30df\u30ea\u79d2\u3067\u3057\u305f&quot;);\r\n\t}\r\n\r\n}\r\n<\/pre>\n<p>\u5b9f\u884c\u7d50\u679c\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n2147483647\u306e\u7d20\u6570\u5224\u5b9a\u7d50\u679c\u306ftrue\u3067\u3059\r\n\u51e6\u7406\u306b\u304b\u304b\u3063\u305f\u6642\u9593\u306f\u20261148\u30df\u30ea\u79d2\u3067\u3057\u305f\r\n<\/pre>\n<p>\u30c6\u30ad\u30b9\u30c8\u306e\u30ea\u30b9\u30c814-2\u306e\u30b3\u30fc\u30c9\u3092\u8ffd\u52a0\u3059\u308b\u3002<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\npackage ex;\r\n\r\nimport java.util.Date;\r\n\r\npublic class Main {\r\n\r\n\tpublic static void main(String[] args) {\r\n\t\tlong start = System.currentTimeMillis();\r\n\t\t\/\/ \u3053\u3053\u3067\u4f55\u3089\u304b\u306e\u6642\u9593\u304c\u304b\u304b\u308b\u51e6\u7406\r\n\t\tPrime p = new Prime();\r\n\t\tboolean b = p.isPrime(Integer.MAX_VALUE);\r\n\t\tSystem.out.println(Integer.MAX_VALUE\r\n\t\t\t\t+ &quot;\u306e\u7d20\u6570\u5224\u5b9a\u7d50\u679c\u306f&quot; + b + &quot;\u3067\u3059&quot;);\r\n\t\tlong end = System.currentTimeMillis();\r\n\t\tSystem.out.println(&quot;\u51e6\u7406\u306b\u304b\u304b\u3063\u305f\u6642\u9593\u306f\u2026&quot;\r\n\t\t\t\t+ (end - start) + &quot;\u30df\u30ea\u79d2\u3067\u3057\u305f&quot;);\r\n\r\n\t\t\/\/ \u30ea\u30b9\u30c814-2\r\n\t\tDate now = new Date();\r\n\t\tSystem.out.println(now);\r\n\t\tSystem.out.println(now.getTime());\r\n\t\tDate past = new Date(1316622225935L);\r\n\t\tSystem.out.println(past);\r\n\t}\r\n\r\n}\r\n<\/pre>\n<p>\u5b9f\u884c\u7d50\u679c\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n2147483647\u306e\u7d20\u6570\u5224\u5b9a\u7d50\u679c\u306ftrue\u3067\u3059\r\n\u51e6\u7406\u306b\u304b\u304b\u3063\u305f\u6642\u9593\u306f\u20261142\u30df\u30ea\u79d2\u3067\u3057\u305f\r\nTue May 07 10:34:32 JST 2019\r\n1557192872306\r\nThu Sep 22 01:23:45 JST 2011\r\n<\/pre>\n<p>\u30c6\u30ad\u30b9\u30c8\u306e\u30ea\u30b9\u30c814-3\u3092CalMain.java\u3068\u3057\u3066\u4f5c\u6210\u3059\u308b\u3002<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\npackage ex;\r\n\r\nimport java.util.Calendar;\r\nimport java.util.Date;\r\n\r\npublic class CalMain {\r\n\r\n\tpublic static void main(String[] args) {\r\n\t\t\/\/ \u73fe\u5728\u306e\u5e74\u3092\u8868\u793a\u3059\u308b\r\n\t\tDate now = new Date();\r\n\t\tCalendar c = Calendar.getInstance();\r\n\t\tc.setTime(now);\r\n\t\tint y = c.get(Calendar.YEAR);\r\n\t\tSystem.out.println(&quot;\u4eca\u5e74\u306f&quot; + y + &quot;\u5e74\u3067\u3059&quot;);\r\n\t\t\/\/ \u6307\u5b9a\u3057\u305f\u65e5\u306eDate\u578b\u306e\u5024\u3092\u5f97\u308b\r\n\t\tc.set(2010, 8, 22, 1, 23, 45);\r\n\t\tDate past = c.getTime();\r\n\t\tSystem.out.println(past);\r\n\t}\r\n\r\n}\r\n<\/pre>\n<p>SimpleDateFormat \u306e\u4f7f\u7528\u4f8b\u3068\u3057\u3066\u30ea\u30b9\u30c814-4 \u306e\u30b3\u30fc\u30c9\u3092CalMain.java\u306b\u8ffd\u52a0\u3059\u308b\u3002<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\npackage ex;\r\n\r\nimport java.text.SimpleDateFormat;\r\nimport java.util.Calendar;\r\nimport java.util.Date;\r\n\r\npublic class CalMain {\r\n\r\n\tpublic static void main(String[] args) throws Exception {\r\n\t\t\/\/ \u73fe\u5728\u306e\u5e74\u3092\u8868\u793a\u3059\u308b\r\n\t\tDate now = new Date();\r\n\t\tCalendar c = Calendar.getInstance();\r\n\t\tc.setTime(now);\r\n\t\tint y = c.get(Calendar.YEAR);\r\n\t\tSystem.out.println(&quot;\u4eca\u5e74\u306f&quot; + y + &quot;\u5e74\u3067\u3059&quot;);\r\n\t\t\/\/ \u6307\u5b9a\u3057\u305f\u65e5\u306eDate\u578b\u306e\u5024\u3092\u5f97\u308b\r\n\t\tc.set(2010, 8, 22, 1, 23, 45);\r\n\t\tDate past = c.getTime();\r\n\t\tSystem.out.println(past);\r\n\r\n\t\t\/\/ \u30ea\u30b9\u30c814-4 \u306e\u30b3\u30fc\u30c9\u3092\u8ffd\u52a0\r\n\t\tSimpleDateFormat f =\r\n\t\t\t\tnew SimpleDateFormat(&quot;yyyy\/MM\/dd HH:mm:ss&quot;);\r\n\t\tString s = f.format(now);\r\n\t\tSystem.out.println(s);\r\n\t\t\/\/ \u6307\u5b9a\u65e5\u6642\u306e\u6587\u5b57\u5217\u3092\u89e3\u6790\u3057Date\u578b\u3068\u3057\u3066\u5f97\u308b\r\n\t\tDate d = f.parse(&quot;2011\/09\/22 01:23:45&quot;);\r\n\t\tSystem.out.println(d);\r\n\t}\r\n\r\n}\r\n<\/pre>\n<p>\u30ea\u30b9\u30c814-5 Empty.java<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\npackage ex;\r\n\r\npublic class Empty {\r\n\r\n}\r\n<\/pre>\n<p>EmptyMain.java (\u30c6\u30ad\u30b9\u30c8\u3067\u306f Main.java)<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\npackage ex;\r\n\r\npublic class EmptyMain {\r\n\r\n\tpublic static void main(String[] args) {\r\n\t\tEmpty e = new Empty();\r\n\t\tString s = e.toString();\r\n\t\tSystem.out.println(s);\r\n\t}\r\n\r\n}\r\n<\/pre>\n<p>\u5b9f\u884c\u7d50\u679c\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3002<br \/>\n@\u306e\u624b\u524d\u306fFQCN\u3067@\u306e\u3042\u3068\u306f\u30cf\u30c3\u30b7\u30e5\u5024\u306e16\u9032\u6570\u8868\u8a18\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nex.Empty@70dea4e\r\n<\/pre>\n<p>toString() \u30e1\u30bd\u30c3\u30c9\u306e\u30ab\u30b9\u30bf\u30de\u30a4\u30ba<br \/>\nHero\u30af\u30e9\u30b9\u3092\u9078\u629e\u3057\u305f\u72b6\u614b\u3067\u3001\u30e1\u30cb\u30e5\u30fc\u304b\u3089[\u30bd\u30fc\u30b9]-[toString()\u751f\u6210]\u3092\u9078\u629e\u3059\u308b\u3002<br \/>\n\u305d\u306e\u307e\u307eOK\u3059\u308b\u3068\u3001Eclipse\u304ctoString()\u30e1\u30bd\u30c3\u30c9\u3092\u751f\u6210\u3057\u3066\u304f\u308c\u308b\u3002<br \/>\ntoString()\u3067\u8868\u793a\u3059\u308b\u5fc5\u8981\u304c\u306a\u3044\u30d5\u30a3\u30fc\u30eb\u30c9\u304c\u3042\u308c\u3070\u3001\u30c1\u30a7\u30c3\u30af\u3092\u5916\u3057\u3066\u304b\u3089OK\u3059\u308b\u3002<\/p>\n<p>Hero.java<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\npackage ex;\r\n\r\npublic class Hero {\r\n\tString name;\r\n\tint hp;\r\n\r\n\t@Override\r\n\tpublic String toString() {\r\n\t\treturn getClass().getName()\r\n\t\t\t\t+ &quot;[name=&quot; + name + &quot;, hp=&quot; + hp + &quot;]&quot;;\r\n\t}\r\n}\r\n<\/pre>\n<p>HeroMain.java<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\npackage ex;\r\n\r\npublic class HeroMain {\r\n\r\n\tpublic static void main(String[] args) {\r\n\t\tHero h = new Hero();\r\n\t\th.name = &quot;\u30df\u30ca\u30c8&quot;;\r\n\t\th.hp = 100;\r\n\t\tSystem.out.println(h.toString());\r\n\t}\r\n\r\n}\r\n<\/pre>\n<p>Hero\u30af\u30e9\u30b9\u3092\u6bd4\u8f03\u3059\u308b\u305f\u3081\u306b equals() \u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3063\u3066\u307f\u308b\u3002<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\npackage ex;\r\n\r\npublic class HeroMain {\r\n\r\n\tpublic static void main(String[] args) {\r\n\t\tHero h = new Hero();\r\n\t\th.name = &quot;\u30df\u30ca\u30c8&quot;;\r\n\t\th.hp = 100;\r\n\t\tSystem.out.println(h.toString());\r\n\t\tHero h2 = new Hero();\r\n\t\th2.name = &quot;\u30df\u30ca\u30c8&quot;;\r\n\t\th2.hp = 100;\r\n\t\tSystem.out.println(h.equals(h2));\r\n\t}\r\n\r\n}\r\n<\/pre>\n<p>\u5b9f\u884c\u7d50\u679c\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nex.Hero[name=\u30df\u30ca\u30c8, hp=100]\r\nfalse\r\n<\/pre>\n<p>\u540d\u524d\u3068hp\u304c\u540c\u3058\u306a\u3089true\u306b\u3057\u305f\u3044\u3002<\/p>\n<p>Eclipse\u306b equals() \u30e1\u30bd\u30c3\u30c9\u3092\u751f\u6210\u3059\u308b\u6a5f\u80fd\u304c\u3042\u308b\u306e\u3067\u3001\u305d\u308c\u3092\u4f7f\u3046\u3068\u4fbf\u5229\u3002<br \/>\nHero\u30af\u30e9\u30b9\u3092\u9078\u629e\u3057\u305f\u72b6\u614b\u3067\u30e1\u30cb\u30e5\u30fc\u304b\u3089[\u30bd\u30fc\u30b9]-[hashCode()\u304a\u3088\u3073equals()\u306e\u751f\u6210]\u3092\u9078\u629e\u3059\u308b\u3002<br \/>\nhp\u3068name\u30d5\u30a3\u30fc\u30eb\u30c9\u306b\u30c1\u30a7\u30c3\u30af\u304c\u5165\u3063\u3066\u3044\u308b\u306e\u3092\u78ba\u8a8d\u3057\u3066OK\u3059\u308b\u3002<br \/>\n\u3059\u308b\u3068\u3001hashCode()\u3068equals()\u30e1\u30bd\u30c3\u30c9\u304c\u751f\u6210\u3055\u308c\u308b\u3002<br \/>\nHeroMain\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001true\u304c\u51fa\u529b\u3055\u308c\u308b\u306e\u304c\u78ba\u8a8d\u3067\u304d\u308b\u3002<\/p>\n<pre class=\"brush: java; highlight: [13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39]; title: ; notranslate\" title=\"\">\r\npackage ex;\r\n\r\npublic class Hero {\r\n\tString name;\r\n\tint hp;\r\n\r\n\t@Override\r\n\tpublic String toString() {\r\n\t\treturn getClass().getName()\r\n\t\t\t\t+ &quot;[name=&quot; + name + &quot;, hp=&quot; + hp + &quot;]&quot;;\r\n\t}\r\n\r\n\t@Override\r\n\tpublic int hashCode() {\r\n\t\tfinal int prime = 31;\r\n\t\tint result = 1;\r\n\t\tresult = prime * result + hp;\r\n\t\tresult = prime * result + ((name == null) ? 0 : name.hashCode());\r\n\t\treturn result;\r\n\t}\r\n\r\n\t@Override\r\n\tpublic boolean equals(Object obj) {\r\n\t\tif (this == obj)\r\n\t\t\treturn true;\r\n\t\tif (obj == null)\r\n\t\t\treturn false;\r\n\t\tif (getClass() != obj.getClass())\r\n\t\t\treturn false;\r\n\t\tHero other = (Hero) obj;\r\n\t\tif (hp != other.hp)\r\n\t\t\treturn false;\r\n\t\tif (name == null) {\r\n\t\t\tif (other.name != null)\r\n\t\t\t\treturn false;\r\n\t\t} else if (!name.equals(other.name))\r\n\t\t\treturn false;\r\n\t\treturn true;\r\n\t}\r\n}\r\n<\/pre>\n<p>HeroMain\u3067h2\u306e\u540d\u524d\u3068HP\u3092\u5909\u66f4\u3057\u3066\u3001\u304d\u3061\u3093\u3068\u5224\u5b9a\u3057\u3066\u3044\u308b\u304b\u78ba\u8a8d\u3059\u308b\u3002<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\npackage ex;\r\n\r\npublic class HeroMain {\r\n\r\n\tpublic static void main(String[] args) {\r\n\t\tHero h = new Hero();\r\n\t\th.name = &quot;\u30df\u30ca\u30c8&quot;;\r\n\t\th.hp = 100;\r\n\t\tSystem.out.println(h.toString());\r\n\t\tHero h2 = new Hero();\r\n\t\th2.name = &quot;\u30df\u30ca\u30c8&quot;;\r\n\t\th2.hp = 100;\r\n\t\tSystem.out.println(h.equals(h2));\r\n\t\th2.hp = 101;\r\n\t\tSystem.out.println(h.equals(h2));\r\n\t\th2.hp = 100;\r\n\t\tSystem.out.println(h.equals(h2));\r\n\t\th2.name = &quot;\u30df\u30ca\u30c8A&quot;;\r\n\t\tSystem.out.println(h.equals(h2));\r\n\t}\r\n\r\n}\r\n<\/pre>\n<p>\u5b9f\u884c\u7d50\u679c\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nex.Hero[name=\u30df\u30ca\u30c8, hp=100]\r\ntrue\r\nfalse\r\ntrue\r\nfalse\r\n<\/pre>\n<p><strong>\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af<\/strong><br \/>\n\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u306f\u3001\u8907\u6570\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u6271\u3046\u4ed5\u7d44\u307f\u3067\u3001Java\u3067\u306fjava.util\u30d1\u30c3\u30b1\u30fc\u30b8\u306b\u30a4\u30f3\u30bf\u30d5\u30a7\u30fc\u30b9\u3084\u30af\u30e9\u30b9\u304c\u7528\u610f\u3055\u308c\u3066\u3044\u308b\u3002<\/p>\n<p>List\u30a4\u30f3\u30bf\u30d5\u30a7\u30fc\u30b9\u306e\u5b9f\u88c5\u3067\u3042\u308bArrayList\u3092\u4f7f\u7528\u3057\u305f\u4f8b\u3002<br \/>\nadd() : \u8981\u7d20\u3092\u8ffd\u52a0\u3059\u308b\u3002<br \/>\nremove() : \u8981\u7d20\u3092\u524a\u9664\u3059\u308b\u3002<br \/>\nsize() : \u8981\u7d20\u306e\u6570\u3002<br \/>\ncontains() : \u8981\u7d20\u304c\u542b\u307e\u308c\u3066\u3044\u308b\u304b\u3069\u3046\u304b\u3092\u8abf\u3079\u308b\u3002<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\npackage ex;\r\n\r\nimport java.util.ArrayList;\r\n\r\npublic class ListMain {\r\n\r\n\tpublic static void main(String[] args) {\r\n\t\tArrayList&lt;String&gt; list = new ArrayList&lt;&gt;();\r\n\t\tlist.add(&quot;\u30d7\u30ec\u30df\u30a2\u30e0\u30e2\u30eb\u30c4&quot;);\r\n\t\tlist.add(&quot;\u30d0\u30c9\u30ef\u30a4\u30b6\u30fc&quot;);\r\n\t\tlist.add(&quot;\u30ae\u30cd\u30b9&quot;);\r\n\t\t\/\/System.out.println(list.get(1));\r\n\t\tlist.add(0, &quot;\u4e00\u756a\u643e\u308a&quot;);\r\n\t\t\/\/System.out.println(list.get(1));\r\n\t\t\/\/ \u30eb\u30fc\u30d7\u3067\u8981\u7d20\u3092\u8868\u793a\r\n\t\tfor (int i = 0; i &lt; list.size(); i++) {\r\n\t\t\tSystem.out.println(i + &quot;:&quot; + list.get(i));\r\n\t\t}\r\n\t\tlist.remove(0);\r\n\t\tfor (String s : list) {\r\n\t\t\tSystem.out.println(s);\r\n\t\t}\r\n\t\tSystem.out.println(list.contains(&quot;\u4e00\u756a\u643e\u308a&quot;));\r\n\t\tlist.remove(&quot;\u30ae\u30cd\u30b9&quot;);\r\n\t\tfor (String s : list) {\r\n\t\t\tSystem.out.println(s);\r\n\t\t}\r\n\t}\r\n\r\n}\r\n<\/pre>\n<p>Set\u30a4\u30f3\u30bf\u30d5\u30a7\u30fc\u30b9\u3092\u5b9f\u88c5\u3057\u305fHashSet\u3092\u4f7f\u7528\u3057\u305f\u4f8b\u3002<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\npackage ex;\r\n\r\nimport java.util.HashSet;\r\nimport java.util.Set;\r\n\r\npublic class SetMain {\r\n\r\n\tpublic static void main(String[] args) {\r\n\t\tSet&lt;String&gt; set = new HashSet&lt;&gt;();\r\n\t\tset.add(&quot;\u30de\u30ea\u30aa&quot;);\r\n\t\tset.add(&quot;\u30eb\u30a4\u30fc\u30b8&quot;);\r\n\t\tset.add(&quot;\u30d4\u30fc\u30c1&quot;);\r\n\t\tfor (String s : set) {\r\n\t\t\tSystem.out.println(s);\r\n\t\t}\r\n\t\tset.add(&quot;\u30de\u30ea\u30aa&quot;);\r\n\t\tfor (String s : set) {\r\n\t\t\tSystem.out.println(s);\r\n\t\t}\r\n\t\tSystem.out.println(set.contains(&quot;\u30d4\u30fc\u30c1&quot;));\r\n\t\tset.remove(&quot;\u30d4\u30fc\u30c1&quot;);\r\n\t\tfor (String s : set) {\r\n\t\t\tSystem.out.println(s);\r\n\t\t}\r\n\t\tSystem.out.println(set.contains(&quot;\u30d4\u30fc\u30c1&quot;));\r\n\t}\r\n\r\n}\r\n<\/pre>\n<p>\u5b9f\u884c\u7d50\u679c\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n\u30de\u30ea\u30aa\r\n\u30d4\u30fc\u30c1\r\n\u30eb\u30a4\u30fc\u30b8\r\n\u30de\u30ea\u30aa\r\n\u30d4\u30fc\u30c1\r\n\u30eb\u30a4\u30fc\u30b8\r\ntrue\r\n\u30de\u30ea\u30aa\r\n\u30eb\u30a4\u30fc\u30b8\r\nfalse\r\n<\/pre>\n<p>Map\u30a4\u30f3\u30bf\u30d5\u30a7\u30fc\u30b9\u3092\u5b9f\u88c5\u3057\u305fHashMap\u3092\u4f7f\u7528\u3057\u305f\u4f8b\u3002<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\npackage ex;\r\n\r\nimport java.util.HashMap;\r\nimport java.util.Map;\r\nimport java.util.Set;\r\n\r\npublic class MapMain {\r\n\r\n\tpublic static void main(String[] args) {\r\n\t\tMap&lt;String, String&gt; map = new HashMap&lt;&gt;();\r\n\t\tmap.put(&quot;m&quot;, &quot;\u30e2\u30f3\u30b9\u30bf\u30fc\u30cf\u30f3\u30bf\u30fc&quot;);\r\n\t\tmap.put(&quot;d&quot;, &quot;\u30c9\u30e9\u30b4\u30f3\u30af\u30a8\u30b9\u30c8&quot;);\r\n\t\tmap.put(&quot;p&quot;, &quot;\u30dd\u30b1\u30c3\u30c8\u30e2\u30f3\u30b9\u30bf\u30fc&quot;);\r\n\t\tSystem.out.println(map.get(&quot;m&quot;));\r\n\t\tSet&lt;String&gt; set = map.keySet();\r\n\t\tfor (String key : set) {\r\n\t\t\tString v = map.get(key);\r\n\t\t\tSystem.out.println(key + &quot;:&quot; + v);\r\n\t\t}\r\n\t\tSystem.out.println(map.containsKey(&quot;a&quot;));\r\n\t\tmap.put(&quot;p&quot;, &quot;\u30d1\u30ba\u30eb\u30a2\u30f3\u30c9\u30c9\u30e9\u30b4\u30f3\u30ba&quot;);\r\n\t\tfor (String key : set) {\r\n\t\t\tString v = map.get(key);\r\n\t\t\tSystem.out.println(key + &quot;:&quot; + v);\r\n\t\t}\r\n\t}\r\n\r\n}\r\n<\/pre>\n<p>\u5b9f\u884c\u7d50\u679c\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n\u30e2\u30f3\u30b9\u30bf\u30fc\u30cf\u30f3\u30bf\u30fc\r\np:\u30dd\u30b1\u30c3\u30c8\u30e2\u30f3\u30b9\u30bf\u30fc\r\nd:\u30c9\u30e9\u30b4\u30f3\u30af\u30a8\u30b9\u30c8\r\nm:\u30e2\u30f3\u30b9\u30bf\u30fc\u30cf\u30f3\u30bf\u30fc\r\nfalse\r\np:\u30d1\u30ba\u30eb\u30a2\u30f3\u30c9\u30c9\u30e9\u30b4\u30f3\u30ba\r\nd:\u30c9\u30e9\u30b4\u30f3\u30af\u30a8\u30b9\u30c8\r\nm:\u30e2\u30f3\u30b9\u30bf\u30fc\u30cf\u30f3\u30bf\u30fc\r\n<\/pre>\n\n<div style=\"font-size: 0px; height: 0px; line-height: 0px; margin: 0; padding: 0; clear: both;\"><\/div>","protected":false},"excerpt":{"rendered":"<p>\u6388\u696d\u306e\u5185\u5bb9\u3092\u8a18\u9332\u3059\u308b\u30d6\u30ed\u30b0 URL: http:\/\/2019se3.satoshis.jp\/ \u30c6\u30ad\u30b9\u30c8\u306e14\u7ae0\u304b\u3089 \u30ea\u30b9\u30c814-1 \u524d\u56de\u306e\u7d20\u6570\u304b\u3069\u3046\u304b\u3092\u5224\u5b9a\u3059\u308b\u305f\u3081\u306eJUnit\u30c6\u30b9\u30c8 PrimeTest.java \u30bf\u30fc\u30b2 &hellip; <a href=\"https:\/\/2019se3.satoshis.jp\/?p=1\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;5\u67087\u65e5&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1,2],"tags":[],"_links":{"self":[{"href":"https:\/\/2019se3.satoshis.jp\/index.php?rest_route=\/wp\/v2\/posts\/1"}],"collection":[{"href":"https:\/\/2019se3.satoshis.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/2019se3.satoshis.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/2019se3.satoshis.jp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/2019se3.satoshis.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1"}],"version-history":[{"count":20,"href":"https:\/\/2019se3.satoshis.jp\/index.php?rest_route=\/wp\/v2\/posts\/1\/revisions"}],"predecessor-version":[{"id":27,"href":"https:\/\/2019se3.satoshis.jp\/index.php?rest_route=\/wp\/v2\/posts\/1\/revisions\/27"}],"wp:attachment":[{"href":"https:\/\/2019se3.satoshis.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/2019se3.satoshis.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/2019se3.satoshis.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}