{"id":283,"date":"2022-08-29T09:23:03","date_gmt":"2022-11-28T02:54:15","guid":{"rendered":"https:\/\/www.silicloud.com\/ja\/blog\/index.php\/2023\/11\/30\/java%e3%81%ab%e3%81%8a%e3%81%91%e3%82%8bstatic%e3%82%ad%e3%83%bc%e3%83%af%e3%83%bc%e3%83%89\/"},"modified":"2025-07-31T22:18:53","modified_gmt":"2025-07-31T13:18:53","slug":"java%e3%81%ab%e3%81%8a%e3%81%91%e3%82%8bstatic%e3%82%ad%e3%83%bc%e3%83%af%e3%83%bc%e3%83%89","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/ja\/blog\/java%e3%81%ab%e3%81%8a%e3%81%91%e3%82%8bstatic%e3%82%ad%e3%83%bc%e3%83%af%e3%83%bc%e3%83%89\/","title":{"rendered":"Java\u306b\u304a\u3051\u308bstatic\u30ad\u30fc\u30ef\u30fc\u30c9"},"content":{"rendered":"<p>Java\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u306b\u304a\u3044\u3066\u3001static\u30ad\u30fc\u30ef\u30fc\u30c9\u306f\u3057\u3070\u3057\u3070\u4f7f\u7528\u3055\u308c\u307e\u3059\u3002Java\u306estatic\u30ad\u30fc\u30ef\u30fc\u30c9\u306f\u3001Java\u3067\u306e\u30af\u30e9\u30b9\u30ec\u30d9\u30eb\u306e\u5909\u6570\u3092\u4f5c\u6210\u3059\u308b\u305f\u3081\u306b\u4f7f\u7528\u3055\u308c\u307e\u3059\u3002static\u5909\u6570\u3068\u30e1\u30bd\u30c3\u30c9\u306f\u30af\u30e9\u30b9\u306e\u4e00\u90e8\u3067\u3042\u308a\u3001\u30af\u30e9\u30b9\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3067\u306f\u306a\u3044\u306e\u3067\u3059\u3002<\/p>\n<h2>Java\u306estatic\u30ad\u30fc\u30ef\u30fc\u30c9<\/h2>\n<p>\u4ee5\u4e0b\u306e\u753b\u50cf\u3067\u793a\u3055\u308c\u3066\u3044\u308b\u3088\u3046\u306b\u3001Java\u306estatic\u30ad\u30fc\u30ef\u30fc\u30c9\u306f5\u3064\u306e\u30b1\u30fc\u30b9\u3067\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u3053\u3053\u3067\u306f\u305d\u306e\u3046\u3061\u306e4\u3064\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u304c\u30015\u3064\u76ee\u306e\u30b1\u30fc\u30b9\u306fJava 8\u3067\u5c0e\u5165\u3055\u308c\u3001Java 8\u306e\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306e\u5909\u66f4\u3067\u8b70\u8ad6\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>Java\u306e\u9759\u7684\u5909\u6570<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\u30af\u30e9\u30b9\u30ec\u30d9\u30eb\u306e\u5909\u6570\u306b\u306fstatic\u30ad\u30fc\u30ef\u30fc\u30c9\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u9759\u7684\u5909\u6570\u306f\u30af\u30e9\u30b9\u5909\u6570\u3067\u3042\u308a\u3001\u30af\u30e9\u30b9\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\/\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306b\u306f\u6240\u5c5e\u3057\u307e\u305b\u3093\u3002\u9759\u7684\u5909\u6570\u306f\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u3059\u3079\u3066\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3067\u5171\u6709\u3055\u308c\u308b\u305f\u3081\u3001\u30b9\u30ec\u30c3\u30c9\u30bb\u30fc\u30d5\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002\u901a\u5e38\u3001\u9759\u7684\u5909\u6570\u306fcommon resources\u3084\u3059\u3079\u3066\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3067\u4f7f\u7528\u3055\u308c\u308b\u5b9a\u6570\u306e\u3088\u3046\u306a\u3082\u306e\u306bfinal\u30ad\u30fc\u30ef\u30fc\u30c9\u3068\u5171\u306b\u4f7f\u7528\u3055\u308c\u307e\u3059\u3002\u3082\u3057\u9759\u7684\u5909\u6570\u304cprivate\u3067\u306f\u306a\u3044\u5834\u5408\u3001ClassName.variableName\u3067\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\/\/\u9759\u7684\u5909\u6570\u306e\u4f8b<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>private static int count;<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>public static String str;<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>public static final String DB_USER = &#8220;myuser&#8221;;<\/ol>\n<\/li>\n<\/ol>\n<p>Java\u306e\u9759\u7684\u30e1\u30bd\u30c3\u30c9<br \/>\n\u9759\u7684\u5909\u6570\u3068\u540c\u69d8\u306b\u3001\u9759\u7684\u30e1\u30bd\u30c3\u30c9\u3082\u30af\u30e9\u30b9\u306b\u6240\u5c5e\u3057\u3001\u30af\u30e9\u30b9\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306b\u6240\u5c5e\u3057\u307e\u305b\u3093\u3002\u9759\u7684\u30e1\u30bd\u30c3\u30c9\u306f\u30af\u30e9\u30b9\u306e\u9759\u7684\u5909\u6570\u306e\u307f\u306b\u30a2\u30af\u30bb\u30b9\u3057\u3001\u30af\u30e9\u30b9\u306e\u9759\u7684\u30e1\u30bd\u30c3\u30c9\u306e\u307f\u3092\u547c\u3073\u51fa\u3059\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u901a\u5e38\u3001\u9759\u7684\u30e1\u30bd\u30c3\u30c9\u306f\u3001\u4ed6\u306e\u30af\u30e9\u30b9\u304c\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u4f5c\u6210\u3059\u308b\u5fc5\u8981\u306a\u304f\u4f7f\u7528\u3067\u304d\u308b\u30e6\u30fc\u30c6\u30a3\u30ea\u30c6\u30a3\u30e1\u30bd\u30c3\u30c9\u3067\u3059\u3002\u305f\u3068\u3048\u3070\u3001Collections\u30af\u30e9\u30b9\u3084Java\u306eWrapper\u30af\u30e9\u30b9\u3001\u30e6\u30fc\u30c6\u30a3\u30ea\u30c6\u30a3\u30af\u30e9\u30b9\u306b\u306f\u591a\u304f\u306e\u9759\u7684\u30e1\u30bd\u30c3\u30c9\u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002java\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u30dd\u30a4\u30f3\u30c8\u3067\u3042\u308bmain()\u30e1\u30bd\u30c3\u30c9\u81ea\u4f53\u3082\u9759\u7684\u30e1\u30bd\u30c3\u30c9\u3067\u3059\u3002<br \/>\n\/\/\u9759\u7684\u30e1\u30bd\u30c3\u30c9\u306e\u4f8b<br \/>\npublic static void setCount(int count) {<br \/>\nif(count &gt; 0)<br \/>\nStaticExample.count = count;<br \/>\n}<\/p>\n<p>\/\/\u9759\u7684\u30e6\u30fc\u30c6\u30a3\u30ea\u30c6\u30a3\u30e1\u30bd\u30c3\u30c9<br \/>\npublic static int addInts(int i, int&#8230;js){<br \/>\nint sum=i;<br \/>\nfor(int x : js) sum+=x;<br \/>\nreturn sum;<br \/>\n}<\/p>\n<p>Java 8\u4ee5\u964d\u3067\u306f\u3001\u30a4\u30f3\u30bf\u30d5\u30a7\u30fc\u30b9\u5185\u3067\u3082\u9759\u7684\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u8a73\u7d30\u306b\u3064\u3044\u3066\u306f\u3001Java 8\u306e\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306e\u5909\u66f4\u3092\u304a\u8aad\u307f\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>Java\u306e\u9759\u7684\u30d6\u30ed\u30c3\u30af<br \/>\nJava\u306e\u9759\u7684\u30d6\u30ed\u30c3\u30af\u306f\u3001Java\u306e\u30af\u30e9\u30b9\u30ed\u30fc\u30c0\u306b\u3088\u3063\u3066\u30af\u30e9\u30b9\u304c\u30e1\u30e2\u30ea\u306b\u30ed\u30fc\u30c9\u3055\u308c\u308b\u3068\u304d\u306b\u5b9f\u884c\u3055\u308c\u308b\u4e00\u9023\u306e\u6587\u3067\u3059\u3002\u9759\u7684\u30d6\u30ed\u30c3\u30af\u306f\u30af\u30e9\u30b9\u306e\u9759\u7684\u5909\u6570\u3092\u521d\u671f\u5316\u3059\u308b\u305f\u3081\u306b\u4f7f\u7528\u3055\u308c\u307e\u3059\u3002\u307b\u3068\u3093\u3069\u306e\u5834\u5408\u3001\u30af\u30e9\u30b9\u304c\u30ed\u30fc\u30c9\u3055\u308c\u308b\u969b\u306b\u9759\u7684\u306a\u30ea\u30bd\u30fc\u30b9\u3092\u4f5c\u6210\u3059\u308b\u305f\u3081\u306b\u4f7f\u7528\u3055\u308c\u307e\u3059\u3002\u9759\u7684\u30d6\u30ed\u30c3\u30af\u3067\u306f\u975e\u9759\u7684\u306a\u5909\u6570\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\u3002\u30af\u30e9\u30b9\u5185\u306b\u8907\u6570\u306e\u9759\u7684\u30d6\u30ed\u30c3\u30af\u3092\u6301\u3064\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u304c\u3001\u3042\u307e\u308a\u610f\u5473\u3092\u6210\u3057\u307e\u305b\u3093\u3002\u9759\u7684\u30d6\u30ed\u30c3\u30af\u306e\u30b3\u30fc\u30c9\u306f\u3001\u30af\u30e9\u30b9\u304c\u30e1\u30e2\u30ea\u306b\u30ed\u30fc\u30c9\u3055\u308c\u308b\u3068\u304d\u306b\u4e00\u5ea6\u3060\u3051\u5b9f\u884c\u3055\u308c\u307e\u3059\u3002<br \/>\nstatic{<br \/>\n\/\/\u30af\u30e9\u30b9\u304c\u30ed\u30fc\u30c9\u3055\u308c\u308b\u969b\u306b\u30ea\u30bd\u30fc\u30b9\u306e\u521d\u671f\u5316\u306b\u4f7f\u7528\u3067\u304d\u307e\u3059<br \/>\nSystem.out.println(&#8220;StaticExample\u306e\u9759\u7684\u30d6\u30ed\u30c3\u30af&#8221;);<br \/>\n\/\/\u9759\u7684\u306a\u5909\u6570\u3068\u30e1\u30bd\u30c3\u30c9\u306b\u306e\u307f\u30a2\u30af\u30bb\u30b9\u3067\u304d\u307e\u3059<br \/>\nstr=&#8221;Test&#8221;;<br \/>\nsetCount(2);<br \/>\n}<\/p>\n<p>Java\u306e\u9759\u7684\u30af\u30e9\u30b9<br \/>\n\u30cd\u30b9\u30c8\u3057\u305f\u30af\u30e9\u30b9\u306b\u306fstatic\u30ad\u30fc\u30ef\u30fc\u30c9\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u304c\u3001\u30c8\u30c3\u30d7\u30ec\u30d9\u30eb\u306e\u30af\u30e9\u30b9\u306b\u306f\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u305b\u3093\u3002\u9759\u7684\u306a\u30cd\u30b9\u30c8\u30af\u30e9\u30b9\u306f\u4ed6\u306e\u30c8\u30c3\u30d7\u30ec\u30d9\u30eb\u30af\u30e9\u30b9\u3068\u540c\u3058\u3067\u3042\u308a\u3001\u5358\u306b\u30d1\u30c3\u30b1\u30fc\u30b8\u30f3\u30b0\u306e\u4fbf\u5b9c\u4e0a\u30cd\u30b9\u30c8\u3057\u3066\u3044\u308b\u3060\u3051\u3067\u3059\u3002\u8a73\u7d30\u306f: Java Nested Classes \u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u30b5\u30f3\u30d7\u30eb\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u4e2d\u3067\u3001Java\u306estatic\u30ad\u30fc\u30ef\u30fc\u30c9\u306e\u4f7f\u7528\u65b9\u6cd5\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002StaticExample.java<\/p>\n<pre class=\"post-pre\"><code>package com.scdev.misc;\r\n\r\npublic class StaticExample {\r\n\r\n    \/\/static block\r\n    static{\r\n        \/\/can be used to initialize resources when class is loaded\r\n        System.out.println(\"StaticExample static block\");\r\n        \/\/can access only static variables and methods\r\n        str=\"Test\";\r\n        setCount(2);\r\n    }\r\n    \r\n    \/\/multiple static blocks in same class\r\n    static{\r\n        System.out.println(\"StaticExample static block2\");\r\n    }\r\n    \r\n    \/\/static variable example\r\n    private static int count; \/\/kept private to control its value through setter\r\n    public static String str;\r\n    \r\n    public int getCount() {\r\n        return count;\r\n    }\r\n\r\n    \/\/static method example\r\n    public static void setCount(int count) {\r\n        if(count &gt; 0)\r\n        StaticExample.count = count;\r\n    }\r\n    \r\n    \/\/static util method\r\n    public static int addInts(int i, int...js){\r\n        int sum=i;\r\n        for(int x : js) sum+=x;\r\n        return sum;\r\n    }\r\n\r\n    \/\/static class example - used for packaging convenience only\r\n    public static class MyStaticClass{\r\n        public int count;\r\n        \r\n    }\r\n\r\n}\r\n<\/code><\/pre>\n<p>\u30c6\u30b9\u30c8\u30d7\u30ed\u30b0\u30e9\u30e0\u3067\u3001\u9759\u7684\u5909\u6570\u3001\u30e1\u30bd\u30c3\u30c9\u3001\u9759\u7684\u30af\u30e9\u30b9\u306e\u4f7f\u3044\u65b9\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002TestStatic.java<\/p>\n<pre class=\"post-pre\"><code>package com.scdev.misc;\r\n\r\npublic class TestStatic {\r\n\r\n    public static void main(String[] args) {\r\n        StaticExample.setCount(5);\r\n        \r\n        \/\/non-private static variables can be accessed with class name\r\n        StaticExample.str = \"abc\";\r\n        StaticExample se = new StaticExample();\r\n        System.out.println(se.getCount());\r\n        \/\/class and instance static variables are same\r\n        System.out.println(StaticExample.str +\" is same as \"+se.str);\r\n        System.out.println(StaticExample.str == se.str);\r\n        \r\n        \/\/static nested classes are like normal top-level classes\r\n        StaticExample.MyStaticClass myStaticClass = new StaticExample.MyStaticClass();\r\n        myStaticClass.count=10;\r\n        \r\n        StaticExample.MyStaticClass myStaticClass1 = new StaticExample.MyStaticClass();\r\n        myStaticClass1.count=20;\r\n        \r\n        System.out.println(myStaticClass.count);\r\n        System.out.println(myStaticClass1.count);\r\n    }\r\n    \r\n}\r\n<\/code><\/pre>\n<p>\u4e0a\u8a18\u306eJava\u306e\u9759\u7684\u30ad\u30fc\u30ef\u30fc\u30c9\u306e\u4f8b\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u51fa\u529b\u306f\u6b21\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>StaticExample static block\r\nStaticExample static block2\r\n5\r\nabc is same as abc\r\ntrue\r\n10\r\n20\r\n<\/code><\/pre>\n<p>\u30af\u30e9\u30b9\u304c\u30e1\u30e2\u30ea\u306b\u8aad\u307f\u8fbc\u307e\u308c\u308b\u3068\u3001\u9759\u7684\u30d6\u30ed\u30c3\u30af\u30b3\u30fc\u30c9\u304c\u6700\u521d\u306b\u5b9f\u884c\u3055\u308c\u3001\u4e00\u5ea6\u3060\u3051\u5b9f\u884c\u3055\u308c\u308b\u3053\u3068\u306b\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u4ed6\u306e\u51fa\u529b\u306f\u3001\u81ea\u5df1\u8aac\u660e\u7684\u3067\u3059\u3002<\/p>\n<h3>Java\u306e\u9759\u7684\u30a4\u30f3\u30dd\u30fc\u30c8<\/h3>\n<p>\u901a\u5e38\u3001\u30af\u30e9\u30b9\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9\u3092\u4f7f\u7528\u3057\u3066\u9759\u7684\u30e1\u30f3\u30d0\u30fc\u306b\u30a2\u30af\u30bb\u30b9\u3057\u307e\u3059\u304c\u3001Java 1.5\u304b\u3089\u306f\u30af\u30e9\u30b9\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9\u3092\u907f\u3051\u308b\u305f\u3081\u306bJava\u306e\u9759\u7684\u30a4\u30f3\u30dd\u30fc\u30c8\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u4ee5\u4e0b\u306bJava\u9759\u7684\u30a4\u30f3\u30dd\u30fc\u30c8\u306e\u7c21\u5358\u306a\u4f8b\u3092\u793a\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>package com.scdev.test;\r\n\r\npublic class A {\r\n\r\n\tpublic static int MAX = 1000;\r\n\t\r\n\tpublic static void foo(){\r\n\t\tSystem.out.println(\"foo static method\");\r\n\t}\r\n}\r\n<\/code><\/pre>\n<pre class=\"post-pre\"><code>package com.scdev.test;\r\n\r\nimport static com.scdev.test.A.MAX;\r\nimport static com.scdev.test.A.foo;\r\n\r\npublic class B {\r\n\r\n\tpublic static void main(String args[]){\r\n\t\tSystem.out.println(MAX); \/\/normally A.MAX\r\n\t\tfoo(); \/\/ normally A.foo()\r\n\t}\r\n}\r\n<\/code><\/pre>\n<p>\u4ee5\u4e0b\u306e\u901a\u308a\u3001\u65e5\u672c\u8a9e\u3067\u306e\u8868\u73fe\u3092\u4e00\u3064\u63d0\u793a\u3057\u307e\u3059\uff1a<\/p>\n<p>\u30a4\u30f3\u30dd\u30fc\u30c8\u6587\u306b\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u30b9\u30bf\u30c6\u30a3\u30c3\u30af\u30a4\u30f3\u30dd\u30fc\u30c8\u306e\u5834\u5408\u306f\u3001import static\u306b\u7d9a\u3051\u3066\u30af\u30e9\u30b9\u306e\u5b8c\u5168\u4fee\u98fe\u3055\u308c\u305f\u30b9\u30bf\u30c6\u30a3\u30c3\u30af\u30e1\u30f3\u30d0\u30fc\u3092\u4f7f\u7528\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u30af\u30e9\u30b9\u306e\u3059\u3079\u3066\u306e\u30b9\u30bf\u30c6\u30a3\u30c3\u30af\u30e1\u30f3\u30d0\u30fc\u3092\u30a4\u30f3\u30dd\u30fc\u30c8\u3059\u308b\u5834\u5408\u306f\u3001import static com.scdev.test.A.*;\u306e\u3088\u3046\u306b*\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u30af\u30e9\u30b9\u306e\u30b9\u30bf\u30c6\u30a3\u30c3\u30af\u5909\u6570\u3092\u8907\u6570\u56de\u4f7f\u7528\u3059\u308b\u5834\u5408\u306b\u306e\u307f\u4f7f\u7528\u3059\u308b\u3079\u304d\u3067\u3042\u308a\u3001\u53ef\u8aad\u6027\u306b\u306f\u3042\u307e\u308a\u826f\u304f\u3042\u308a\u307e\u305b\u3093\u3002\u66f4\u65b0\u60c5\u5831\uff1a\u6700\u8fd1\u3001Java\u306estatic\u30ad\u30fc\u30ef\u30fc\u30c9\u306b\u3064\u3044\u3066\u8aac\u660e\u3059\u308b\u305f\u3081\u306e\u30d3\u30c7\u30aa\u3092\u4f5c\u6210\u3057\u307e\u3057\u305f\u3002\u4ee5\u4e0b\u306e\u30ea\u30f3\u30af\u304b\u3089\u3054\u89a7\u304f\u3060\u3055\u3044\u3002https:\/\/www.youtube.com\/watch?v=2e-l1vb\\_fwM<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Java\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u306b\u304a\u3044\u3066\u3001static\u30ad\u30fc\u30ef\u30fc\u30c9\u306f\u3057\u3070\u3057\u3070\u4f7f\u7528\u3055\u308c\u307e\u3059\u3002Java\u306estatic\u30ad\u30fc\u30ef\u30fc\u30c9\u306f\u3001Java\u3067\u306e\u30af\u30e9\u30b9\u30ec\u30d9\u30eb\u306e\u5909\u6570\u3092\u4f5c\u6210\u3059\u308b\u305f\u3081\u306b\u4f7f\u7528\u3055\u308c\u307e\u3059\u3002static\u5909\u6570\u3068\u30e1\u30bd\u30c3\u30c9\u306f\u30af\u30e9\u30b9\u306e\u4e00\u90e8\u3067\u3042\u308a [&hellip;]<\/p>\n","protected":false},"author":6,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[26,61],"class_list":["post-283","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-26","tag-61"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Java\u306b\u304a\u3051\u308bstatic\u30ad\u30fc\u30ef\u30fc\u30c9 - Blog - Silicon Cloud<\/title>\n<meta name=\"description\" content=\"Java\u306b\u304a\u3051\u308bstatic\u30ad\u30fc\u30ef\u30fc\u30c9\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/ja\/blog\/java\u306b\u304a\u3051\u308bstatic\u30ad\u30fc\u30ef\u30fc\u30c9\/\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Java\u306b\u304a\u3051\u308bstatic\u30ad\u30fc\u30ef\u30fc\u30c9\" \/>\n<meta property=\"og:description\" content=\"Java\u306b\u304a\u3051\u308bstatic\u30ad\u30fc\u30ef\u30fc\u30c9\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/ja\/blog\/java\u306b\u304a\u3051\u308bstatic\u30ad\u30fc\u30ef\u30fc\u30c9\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2022-11-28T02:54:15+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-07-31T13:18:53+00:00\" \/>\n<meta name=\"author\" content=\"\u6d77\u6597, \u8475\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u57f7\u7b46\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u6d77\u6597, \u8475\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593\" \/>\n\t<meta name=\"twitter:data2\" content=\"11\u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/java%e3%81%ab%e3%81%8a%e3%81%91%e3%82%8bstatic%e3%82%ad%e3%83%bc%e3%83%af%e3%83%bc%e3%83%89\/\",\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/java%e3%81%ab%e3%81%8a%e3%81%91%e3%82%8bstatic%e3%82%ad%e3%83%bc%e3%83%af%e3%83%bc%e3%83%89\/\",\"name\":\"Java\u306b\u304a\u3051\u308bstatic\u30ad\u30fc\u30ef\u30fc\u30c9 - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#website\"},\"datePublished\":\"2022-11-28T02:54:15+00:00\",\"dateModified\":\"2025-07-31T13:18:53+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/20cfc053626f4d45c0fa7a4e7964b5b6\"},\"description\":\"Java\u306b\u304a\u3051\u308bstatic\u30ad\u30fc\u30ef\u30fc\u30c9\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002\",\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/java%e3%81%ab%e3%81%8a%e3%81%91%e3%82%8bstatic%e3%82%ad%e3%83%bc%e3%83%af%e3%83%bc%e3%83%89\/#breadcrumb\"},\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/ja\/blog\/java%e3%81%ab%e3%81%8a%e3%81%91%e3%82%8bstatic%e3%82%ad%e3%83%bc%e3%83%af%e3%83%bc%e3%83%89\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/java%e3%81%ab%e3%81%8a%e3%81%91%e3%82%8bstatic%e3%82%ad%e3%83%bc%e3%83%af%e3%83%bc%e3%83%89\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/ja\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\u306b\u304a\u3051\u308bstatic\u30ad\u30fc\u30ef\u30fc\u30c9\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"ja\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/20cfc053626f4d45c0fa7a4e7964b5b6\",\"name\":\"\u6d77\u6597, \u8475\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/25aec9a18954b6bfb7e4f7219c2923d62c6f0c9f4d5c0171228fe41751c0ab7a?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/25aec9a18954b6bfb7e4f7219c2923d62c6f0c9f4d5c0171228fe41751c0ab7a?s=96&d=mm&r=g\",\"caption\":\"\u6d77\u6597, \u8475\"},\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/author\/kaitoaoi\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/java%e3%81%ab%e3%81%8a%e3%81%91%e3%82%8bstatic%e3%82%ad%e3%83%bc%e3%83%af%e3%83%bc%e3%83%89\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Java\u306b\u304a\u3051\u308bstatic\u30ad\u30fc\u30ef\u30fc\u30c9 - Blog - Silicon Cloud","description":"Java\u306b\u304a\u3051\u308bstatic\u30ad\u30fc\u30ef\u30fc\u30c9\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/ja\/blog\/java\u306b\u304a\u3051\u308bstatic\u30ad\u30fc\u30ef\u30fc\u30c9\/","og_locale":"ja_JP","og_type":"article","og_title":"Java\u306b\u304a\u3051\u308bstatic\u30ad\u30fc\u30ef\u30fc\u30c9","og_description":"Java\u306b\u304a\u3051\u308bstatic\u30ad\u30fc\u30ef\u30fc\u30c9\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002","og_url":"https:\/\/www.silicloud.com\/ja\/blog\/java\u306b\u304a\u3051\u308bstatic\u30ad\u30fc\u30ef\u30fc\u30c9\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2022-11-28T02:54:15+00:00","article_modified_time":"2025-07-31T13:18:53+00:00","author":"\u6d77\u6597, \u8475","twitter_card":"summary_large_image","twitter_misc":{"\u57f7\u7b46\u8005":"\u6d77\u6597, \u8475","\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593":"11\u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/ja\/blog\/java%e3%81%ab%e3%81%8a%e3%81%91%e3%82%8bstatic%e3%82%ad%e3%83%bc%e3%83%af%e3%83%bc%e3%83%89\/","url":"https:\/\/www.silicloud.com\/ja\/blog\/java%e3%81%ab%e3%81%8a%e3%81%91%e3%82%8bstatic%e3%82%ad%e3%83%bc%e3%83%af%e3%83%bc%e3%83%89\/","name":"Java\u306b\u304a\u3051\u308bstatic\u30ad\u30fc\u30ef\u30fc\u30c9 - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/#website"},"datePublished":"2022-11-28T02:54:15+00:00","dateModified":"2025-07-31T13:18:53+00:00","author":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/20cfc053626f4d45c0fa7a4e7964b5b6"},"description":"Java\u306b\u304a\u3051\u308bstatic\u30ad\u30fc\u30ef\u30fc\u30c9\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002","breadcrumb":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/java%e3%81%ab%e3%81%8a%e3%81%91%e3%82%8bstatic%e3%82%ad%e3%83%bc%e3%83%af%e3%83%bc%e3%83%89\/#breadcrumb"},"inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/ja\/blog\/java%e3%81%ab%e3%81%8a%e3%81%91%e3%82%8bstatic%e3%82%ad%e3%83%bc%e3%83%af%e3%83%bc%e3%83%89\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/ja\/blog\/java%e3%81%ab%e3%81%8a%e3%81%91%e3%82%8bstatic%e3%82%ad%e3%83%bc%e3%83%af%e3%83%bc%e3%83%89\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/ja\/blog\/"},{"@type":"ListItem","position":2,"name":"Java\u306b\u304a\u3051\u308bstatic\u30ad\u30fc\u30ef\u30fc\u30c9"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/ja\/blog\/#website","url":"https:\/\/www.silicloud.com\/ja\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"ja"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/20cfc053626f4d45c0fa7a4e7964b5b6","name":"\u6d77\u6597, \u8475","image":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/25aec9a18954b6bfb7e4f7219c2923d62c6f0c9f4d5c0171228fe41751c0ab7a?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/25aec9a18954b6bfb7e4f7219c2923d62c6f0c9f4d5c0171228fe41751c0ab7a?s=96&d=mm&r=g","caption":"\u6d77\u6597, \u8475"},"url":"https:\/\/www.silicloud.com\/ja\/blog\/author\/kaitoaoi\/"},{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.silicloud.com\/ja\/blog\/java%e3%81%ab%e3%81%8a%e3%81%91%e3%82%8bstatic%e3%82%ad%e3%83%bc%e3%83%af%e3%83%bc%e3%83%89\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/283","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/comments?post=283"}],"version-history":[{"count":1,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/283\/revisions"}],"predecessor-version":[{"id":38635,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/283\/revisions\/38635"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/media?parent=283"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/categories?post=283"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/tags?post=283"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}