{"id":438,"date":"2025-06-14T17:06:56","date_gmt":"2025-06-14T08:06:56","guid":{"rendered":"https:\/\/se-pg-toolbox.com\/?p=438"},"modified":"2025-06-14T17:06:58","modified_gmt":"2025-06-14T08:06:58","slug":"%e3%80%90java%e3%80%91%e3%80%90%e5%9f%ba%e7%a4%8e%e7%b7%a8%e3%80%91%e3%81%82%e3%81%be%e3%82%8a%e3%82%84%e3%81%a3%e3%81%a6%e6%ac%b2%e3%81%97%e3%81%8f%e3%81%aa%e3%81%84%e3%83%ab%e3%83%bc%e3%83%97","status":"publish","type":"post","link":"https:\/\/se-pg-toolbox.com\/?p=438","title":{"rendered":"\u3010Java\u3011\u3010\u57fa\u790e\u7de8\u3011\u3042\u307e\u308a\u3084\u3063\u3066\u6b32\u3057\u304f\u306a\u3044\u30eb\u30fc\u30d7\u6587\u306e\u66f8\u304d\u65b9\uff08while(true)\u3001for( ; ; )\uff09"},"content":{"rendered":"\n<p>Java\u3067\u30eb\u30fc\u30d7\u6587\u3092\u5b9f\u88c5\u3059\u308b\u65b9\u6cd5\u3068\u3057\u3066for\u3001while\u3001do\uff5ewhile\u306a\u3069\u306e\u66f8\u304d\u65b9\u304c\u3042\u308a\u307e\u3059\u304c\u3001\u4eca\u56de\u306f\u3042\u307e\u308a\u826f\u304f\u306a\u3044\u66f8\u304d\u65b9\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002<br><br>\u3069\u3061\u3089\u3082\u30eb\u30fc\u30d7\u6587\u306e\u7d42\u4e86\u6761\u4ef6\u304c\u3001\u30eb\u30fc\u30d7\u6587\u5185\u3092\u8aad\u307e\u306a\u3044\u3068\u5206\u304b\u3089\u305a\u3001\u4e0b\u624b\u306b\u4f7f\u3046\u3068\u7121\u9650\u30eb\u30fc\u30d7\u306b\u306f\u307e\u308b\u6050\u308c\u304c\u3042\u308a\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u8aad\u307f\u306b\u304f\u3055\u3001\u30d0\u30b0\u306e\u898b\u3064\u3051\u306b\u304f\u3055\u306e\u89b3\u70b9\u304b\u3089\u500b\u4eba\u7684\u306b\u63a8\u5968\u3059\u308b\u66f8\u304d\u65b9\u3068\u306f\u8a00\u3048\u307e\u305b\u3093\u3002<br><br>\u3053\u3053\u3067\u7d39\u4ecb\u3059\u308b\u66f8\u304d\u65b9\u306f\u7d76\u5bfe\u306b\u4f7f\u308f\u306a\u3044\u3088\u3046\u306b\u666e\u6bb5\u304b\u3089\u30b3\u30fc\u30c9\u3092\u66f8\u304f\u306e\u3092\u5fc3\u639b\u3051\u3066\u4e0b\u3055\u3044\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u2460while(true)<\/h2>\n\n\n\n<p>\u307e\u305a\u6700\u521d\u306b\u7d39\u4ecb\u3059\u308b\u306e\u306fwhile\u6587\u306e\u7d99\u7d9a\u6761\u4ef6\u306btrue\u3092\u5165\u308c\u308b\u66f8\u304d\u65b9\u3067\u3059\u3002<br><br>\u4f8b\u3048\u3070\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u66f8\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\" data-line=\"6-10\"><code>\t\t\/\/\u5408\u8a08\n        int sum = 0;\n        \/\/\u52a0\u7b97\u3059\u308b\u6570\n        int i = 1;\n        \/\/1\uff5e100\u307e\u3067\u3092\u5408\u8a08\u3059\u308b\n        while(true) {\n        \tsum = sum + i;\n        \ti++;\n        \tif(i &gt; 100) break;\n        }\n        \/\/\u7d50\u679c\u3092\u30b3\u30f3\u30bd\u30fc\u30eb\u306b\u8868\u793a\n        System.out.print(sum);<\/code><\/pre><\/div>\n\n\n\n<p>\u4e0a\u8a18\u306e\u7c21\u7d20\u306a\u30b3\u30fc\u30c9\u3067\u3082\u30eb\u30fc\u30d7\u306e\u7d42\u4e86\u6761\u4ef6\u3092while\u6587\u306e\u4e2d\u3067\u898b\u3064\u3051\u306a\u3044\u3068\u3044\u3051\u307e\u305b\u3093\u3002<br><br>\u4f8b\u3068\u3057\u3066\u6319\u3052\u305f\u30b3\u30fc\u30c9\u306fwhile\u6587\u306e\u5185\u5bb9\u304c\u77ed\u3044\u304b\u3089\u7c21\u5358\u306b\u7d42\u4e86\u6761\u4ef6\u3092\u898b\u3064\u3051\u3089\u308c\u307e\u3059\u304c\u3001\u5b9f\u969b\u306b\u958b\u767a\u3059\u308b\u30b3\u30fc\u30c9\u306fwhile\u6587\u306e\u4e2d\u3067\u5206\u5c90\u51e6\u7406\u3092\u884c\u3063\u305f\u308a\u3001\u3055\u3089\u306b\u30eb\u30fc\u30d7\u51e6\u7406\u3092\u884c\u3063\u305f\u308a\u3059\u308b\u3053\u3068\u3082\u3042\u308b\u3053\u3068\u3067\u3057\u3087\u3046\u3002<br><br>\u305d\u306e\u3088\u3046\u306bwhile\u6587\u306e\u4e2d\u3067\u8907\u96d1\u306a\u51e6\u7406\u304c\u884c\u308f\u308c\u3066\u3044\u308b\u5834\u5408\u3001\u5fc5\u305a\u30eb\u30fc\u30d7\u304c\u7d42\u4e86\u3059\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u308b\u304b\u3001\u30eb\u30fc\u30d7\u306e\u7d42\u4e86\u6761\u4ef6\u306f\u3069\u3046\u306a\u3063\u3066\u3044\u308b\u304b\u3092\u8ffd\u3063\u3066\u3044\u304b\u306a\u3051\u308c\u3070\u306a\u3089\u305a\u3001\u30b3\u30fc\u30c9\u3092\u8aad\u3080\u6642\u9593\u304c\u4f59\u8a08\u306b\u304b\u304b\u3063\u3066\u3057\u307e\u3044\u307e\u3059\u3002<br><br>\u305d\u306e\u305f\u3081\u3001\u30b3\u30fc\u30c9\u306e\u53ef\u8aad\u6027\u304c\u4e0b\u304c\u308a\u3001\u4fdd\u5b88\u6027\u3082\u4e0b\u304c\u3063\u3066\u3057\u307e\u3046\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<br><br>C\u8a00\u8a9e\u7cfb\u306e\u4e2d\u3067\u306fwhile(1)\u3068\u66f8\u3051\u308b\u8a00\u8a9e\u3082\u3042\u308a\u307e\u3059\u304c\u3001\u3053\u308c\u3082\u300c1\u3063\u3066\u4f55\uff1f\u300d\u3068\u30011\u304ctrue\u306e\u5024\u3067\u3042\u308b\u3053\u3068\u3092\u7406\u89e3\u3057\u3066\u3044\u306a\u3044\u3068\u3001\u8aad\u307f\u3065\u3089\u3044\u30b3\u30fc\u30c9\u306b\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3059\u3002<br><br>\u3067\u3059\u306e\u3067\u3001while\u6587\u3092\u4f7f\u3046\u6642\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306bwhile\u306e\u7d99\u7d9a\u6761\u4ef6\u3092\u304d\u3061\u3093\u3068\u660e\u8a18\u3057\u3001\u30d0\u30b0\u304c\u8d77\u304d\u306a\u3044\u3088\u3046\u306b\u3057\u3063\u304b\u308a\u3068\u8aad\u307f\u3084\u3059\u3044\u30b3\u30fc\u30c9\u3092\u66f8\u304f\u3088\u3046\u306b\u6c17\u3092\u4ed8\u3051\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>\t\t\/\/\u5408\u8a08\n        int sum = 0;\n        \/\/\u52a0\u7b97\u3059\u308b\u6570\n        int i = 1;\n        \/\/1\uff5e100\u307e\u3067\u3092\u5408\u8a08\u3059\u308b\n        while(i &lt;= 100) {\n        \tsum = sum + i;\n        \ti++;\n        }\n        \/\/\u7d50\u679c\u3092\u30b3\u30f3\u30bd\u30fc\u30eb\u306b\u8868\u793a\n        System.out.print(sum);<\/code><\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">\u2461for( ; ; )<\/h2>\n\n\n\n<p>2\u3064\u76ee\u306ffor\u6587\u306e\u4e2d\u306b\u4f55\u3082\u66f8\u304b\u306a\u3044\u3067\u3001\u9854\u6587\u5b57\u307f\u305f\u3044\u306b\u306a\u3063\u3066\u3044\u308b\u66f8\u304d\u65b9\u3067\u3059\u3002<br><br>\u4f8b\u3048\u3070\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u66f8\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\" data-line=\"6-10\"><code>\t\t\/\/\u5408\u8a08\n        int sum = 0;\n        \/\/\u52a0\u7b97\u3059\u308b\u6570\n        int i = 1;\n        \/\/1\uff5e100\u307e\u3067\u3092\u5408\u8a08\u3059\u308b\n        for( ; ; ){\n        \tsum = sum + i;\n        \ti++;\n        \tif(i &gt; 100) break;\n        }\n        \/\/\u7d50\u679c\u3092\u30b3\u30f3\u30bd\u30fc\u30eb\u306b\u8868\u793a\n        System.out.print(sum);<\/code><\/pre><\/div>\n\n\n\n<p>\u3053\u308c\u306f\u3001\u958b\u59cb\u6761\u4ef6\u3001\u7d42\u4e86\u6761\u4ef6\u3001for\u6587\u3092\u7e70\u308a\u8fd4\u3057\u305f\u969b\u306e\u5909\u6570\u306e\u52a0\u6e1b\u7b97\u3092\u7701\u7565\u3057\u305f\u66f8\u304d\u65b9\u3068\u306a\u308a\u3001while(true)\u3068\u540c\u3058\u3088\u3046\u306b\u3001\u7d42\u4e86\u6761\u4ef6\u3092\u30eb\u30fc\u30d7\u6587\u5185\u3092\u8ffd\u3063\u3066\u3044\u304b\u306a\u3044\u3068\u3044\u3051\u307e\u305b\u3093\u3002<br><br>\u6ce8\u610f\u3057\u305f\u3044\u3053\u3068\u306fwhile(true)\u3068\u5168\u304f\u540c\u3058\u3067\u3001\u30b3\u30fc\u30c9\u306e\u53ef\u8aad\u6027\u306e\u4f4e\u4e0b\u3068\u3001\u4fdd\u5b88\u6027\u306e\u4f4e\u4e0b\u304c\u61f8\u5ff5\u3055\u308c\u307e\u3059\u3002<br><br>\u3053\u306e\u66f8\u304d\u65b9\u3092\u3057\u3066\u3044\u308b\u30b3\u30fc\u30c9\u3092\u898b\u305f\u3053\u3068\u304c\u5b9f\u969b\u306b\u3042\u308b\u306e\u3067\u3059\u304c\u3001\u6298\u89d2for\u6587\u3092\u4f7f\u3063\u3066\u3044\u308b\u306e\u306b\u306a\u305c\u7121\u9650\u30eb\u30fc\u30d7\u306b\u306a\u308b\u3088\u3046\u306a\u66f8\u304d\u65b9\u3092\u3057\u3066\u3044\u308b\u304b\u306e\u610f\u56f3\u304c\u5168\u304f\u7406\u89e3\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u3002<br><br>\u305d\u306e\u305f\u3081\u3001\u7121\u9650\u30eb\u30fc\u30d7\u3092\u5b9f\u73fe\u3059\u308b\u305f\u3081\u306bfor\u6587\u3092\u4f7f\u3046\u3053\u3068\u306f\u500b\u4eba\u7684\u306b\u63a8\u5968\u3057\u307e\u305b\u3093\u3002<br><br>\u305d\u3082\u305d\u3082\u7121\u9650\u30eb\u30fc\u30d7\u306b\u306a\u308b\u30b3\u30fc\u30c9\u3092\u66f8\u3044\u3066\u306f\u3044\u3051\u306a\u3044\u3068\u3044\u3046\u3053\u3068\u306f\u524d\u63d0\u3067\u3042\u308a\u3001\u305d\u306e\u30ea\u30b9\u30af\u3092\u6975\u9650\u306b\u4e0b\u3052\u308b\u305f\u3081\u306b\u3001\u7e70\u308a\u8fd4\u3057\u51e6\u7406\u3084\u30eb\u30fc\u30d7\u51e6\u7406\u3067\u306f\u7d42\u4e86\u6761\u4ef6\u3092\u660e\u793a\u3059\u308b\u3068\u3044\u3046\u66f8\u304d\u65b9\u306e\u7656\u3092\u3064\u3051\u308b\u3053\u3068\u3092\u610f\u8b58\u3057\u306a\u3051\u308c\u3070\u306a\u308a\u307e\u305b\u3093\u3002<br><br>\u3061\u306a\u307f\u306b\u3001\u4f8b\u3067\u6319\u3052\u305f\u30b3\u30fc\u30c9\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u66f8\u3051\u3070\u6e08\u3080\u8a71\u3067\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>\t\t\/\/\u5408\u8a08\n        int sum = 0;\n        \/\/\u52a0\u7b97\u3059\u308b\u6570\n        int i = 1;\n        \/\/1\uff5e100\u307e\u3067\u3092\u5408\u8a08\u3059\u308b\n        for(i = 1; i &lt;= 100 ; i++){\n        \tsum = sum + i;\n        }\n        \/\/\u7d50\u679c\u3092\u30b3\u30f3\u30bd\u30fc\u30eb\u306b\u8868\u793a\n        System.out.print(sum);<\/code><\/pre><\/div>\n\n\n\n<p>\u3053\u308c\u3092\u308f\u3056\u308f\u3056for(;;)\u3092\u4f7f\u3063\u3066\u66f8\u304f\u30e1\u30ea\u30c3\u30c8\u306f\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u307e\u3068\u3081<\/h2>\n\n\n\n<p>\u4eca\u56de\u306f\u3042\u307e\u308a\u3084\u3063\u3066\u6b32\u3057\u304f\u306a\u3044\u30eb\u30fc\u30d7\u6587\u306e\u66f8\u304d\u65b9\u3068\u3057\u3066\u4ee5\u4e0b\u306e2\u3064\u3092\u7d39\u4ecb\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>while(true)<\/li>\n\n\n\n<li>for(;;)<\/li>\n<\/ol>\n\n\n\n<p>\u3069\u3061\u3089\u3082\u81ea\u5206\u304c\u5b9f\u969b\u306b\u898b\u305f\u3053\u3068\u304c\u3042\u308b\u30eb\u30fc\u30d7\u306e\u66f8\u304d\u65b9\u3067\u3059\u304c\u3001\u57fa\u672c\u7684\u306b\u30d7\u30ed\u30b0\u30e9\u30e0\u3068\u3044\u3046\u306e\u306f\u6709\u9650\u6642\u9593\u3067\u51e6\u7406\u304c\u5b8c\u4e86\u3059\u308b\u30b3\u30fc\u30c9\u3092\u66f8\u304b\u306a\u3051\u308c\u3070\u306a\u308a\u307e\u305b\u3093\u3002<br><br>\u3057\u304b\u3057\u3001\u4e0a\u8a182\u3064\u306e\u66f8\u304d\u65b9\u306f\u3069\u306e\u30eb\u30fc\u30c8\u3092\u901a\u3063\u3066\u3082\u30eb\u30fc\u30d7\u6587\u304c\u7d42\u4e86\u3059\u308b\u3088\u3046\u306b\u6ce8\u610f\u3092\u6255\u3046\u5fc5\u8981\u304c\u3042\u308a\u3001\u6ce8\u610f\u3092\u6020\u308b\u3068\u7121\u9650\u30eb\u30fc\u30d7\u3067\u51e6\u7406\u304c\u7d42\u4e86\u3057\u306a\u3044\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<br><br>\u53ef\u8aad\u6027\u3082\u843d\u3061\u308b\u3057\u3001\u4fdd\u5b88\u6027\u3082\u843d\u3061\u308b\u3001\u305d\u3046\u3067\u3042\u308c\u3070\u6700\u521d\u304b\u3089\u3053\u306e\u66f8\u304d\u65b9\u3092\u4f7f\u308f\u306a\u3051\u308c\u3070\u3044\u3044\u3060\u3051\u3067\u3059\u3002<br><br>\u3053\u306e\u66f8\u304d\u65b9\u3092\u77e5\u3063\u3066\u3044\u3066\u5049\u3044\u3068\u601d\u3063\u3066\u4f7f\u3046\u4eba\u304c\u5c45\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u304c\u3001\u305d\u308c\u306f\u30b3\u30fc\u30c9\u3092\u66f8\u304f\u4eba\u306e\u30a8\u30b4\u3067\u3057\u304b\u3042\u308a\u307e\u305b\u3093\u3002<br><br>\u8ab0\u3082\u304c\u8aad\u307f\u3084\u3059\u3044\u3001\u4fdd\u5b88\u3092\u3057\u3084\u3059\u3044\u3068\u3044\u3046\u306e\u304c\u3001\u826f\u3044\u30b3\u30fc\u30c9\u3067\u3042\u308b\u3068\u500b\u4eba\u7684\u306b\u8003\u3048\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p><span class=\"marker\">\u4eca\u56de\u306e\u8a18\u4e8b\u306f\u3053\u3053\u307e\u3067\u3068\u306a\u308a\u307e\u3059\u3002<br>\u307e\u305f\u6b21\u306e\u8a18\u4e8b\u3067\u304a\u4f1a\u3044\u3057\u307e\u3057\u3087\u3046\u3002<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Java\u3067\u30eb\u30fc\u30d7\u6587\u3092\u5b9f\u88c5\u3059\u308b\u65b9\u6cd5\u3068\u3057\u3066for\u3001while\u3001do\uff5ewhile\u306a\u3069\u306e\u66f8\u304d\u65b9\u304c\u3042\u308a\u307e\u3059\u304c\u3001\u4eca\u56de\u306f\u3042\u307e\u308a\u826f\u304f\u306a\u3044\u66f8\u304d\u65b9\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002 \u3069\u3061\u3089\u3082\u30eb\u30fc\u30d7\u6587\u306e\u7d42\u4e86\u6761\u4ef6\u304c\u3001\u30eb\u30fc\u30d7\u6587\u5185\u3092\u8aad\u307e\u306a\u3044\u3068\u5206\u304b\u3089\u305a\u3001\u4e0b\u624b\u306b\u4f7f\u3046\u3068\u7121\u9650<\/p>\n","protected":false},"author":2,"featured_media":160,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jin_ogp_image_url":"","_jin_last_featured_id":0,"footnotes":""},"categories":[9,5],"tags":[25,15,11,4],"class_list":["post-438","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-java","category-5","tag-c","tag-java","tag-php","tag-4"],"_links":{"self":[{"href":"https:\/\/se-pg-toolbox.com\/index.php?rest_route=\/wp\/v2\/posts\/438","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/se-pg-toolbox.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/se-pg-toolbox.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/se-pg-toolbox.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/se-pg-toolbox.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=438"}],"version-history":[{"count":2,"href":"https:\/\/se-pg-toolbox.com\/index.php?rest_route=\/wp\/v2\/posts\/438\/revisions"}],"predecessor-version":[{"id":440,"href":"https:\/\/se-pg-toolbox.com\/index.php?rest_route=\/wp\/v2\/posts\/438\/revisions\/440"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/se-pg-toolbox.com\/index.php?rest_route=\/wp\/v2\/media\/160"}],"wp:attachment":[{"href":"https:\/\/se-pg-toolbox.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=438"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/se-pg-toolbox.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=438"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/se-pg-toolbox.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=438"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}