{"id":335,"date":"2019-02-11T20:41:12","date_gmt":"2019-02-11T12:41:12","guid":{"rendered":"http:\/\/www.eait.co\/?p=335"},"modified":"2019-04-05T12:34:20","modified_gmt":"2019-04-05T04:34:20","slug":"java2-2%e5%91%bd%e4%bb%a4%e6%8d%a2%e8%a1%8c%e7%94%a8%e5%a4%a7%e6%8b%ac%e5%8f%b7","status":"publish","type":"post","link":"https:\/\/notes.coremix.net\/?p=335","title":{"rendered":"Java2-2\u547d\u4ee4\u6362\u884c\u7528\u5927\u62ec\u53f7"},"content":{"rendered":"<pre>\/**\r\n * Created by xabcd on 2019\/2\/11.\r\n *\/\r\npublic class TestJava2_2\r\n{public static void main(String args[])\r\n{\r\n    int x;\r\n    int y;\r\n    for(x=1;x&lt;3;x++)\r\n    {\r\n        System.out.println\r\n        (x+\"*\"+x+\"=\"+x*x);\/\/\u547d\u4ee4\u4e0d\u6b62\u4e00\u884c\u65f6\u9700\u8981\u7528\u5927\u62ec\u53f7\r\n    }\r\n    for(y=2;y&lt;5;y++)\r\n        System.out.println(y);\r\n}\r\n}\r\n\r\n\r\n\r\n\u7ed3\u679c\uff1a\r\n1*1=1\r\n2*2=4\r\n2\r\n3\r\n4\r\n\r\n\r\n\r\n<\/pre>\n<p>main() \u65b9\u6cd5 \u4e3a \u7a0b\u5e8f \u7684 \u4e3b \u65b9\u6cd5\uff0c \u5728 \u4e00\u4e2a Java \u7a0b\u5e8f \u4e2d\u6709 \u4e14 \u53ea\u80fd \u6709\u4e00\u4e2a main() \u65b9\u6cd5\uff0c \u5b83\u662f \u7a0b\u5e8f \u8fd0\u884c \u7684 \u5f00\u7aef\u3002<\/p>\n<p>public \u4ee3\u8868 main() \u516c\u6709 \u7684 method\uff1b static \u8868\u793a main() \u5728 \u6ca1\u6709 \u521b\u5efa \u7c7b \u5bf9\u8c61 \u7684 \u60c5\u51b5\u4e0b\uff0c \u4ecd\u7136 \u53ef\u4ee5 \u88ab \u8fd0\u884c\uff1b void \u5219 \u8868\u793a main() \u65b9\u6cd5 \u6ca1\u6709 \u8fd4\u56de \u503c\u3002 main \u540e\u9762 \u62ec\u53f7\uff08\uff09 \u4e2d\u7684 \u53c2\u6570 String args[] \u8868\u793a \u8fd0\u884c \u8be5 \u7a0b\u5e8f \u65f6 \u6240\u9700 \u8981\u7684 \u53c2\u6570\uff0c \u8fd9\u662f \u56fa\u5b9a \u7684 \u7528\u6cd5\uff0c<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\/** * Created by xabcd on 2019\/2\/11. *\/ public class Te [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22,24],"tags":[],"class_list":["post-335","post","type-post","status-publish","format-standard","hentry","category-java","category-base_code"],"blocksy_meta":[],"_links":{"self":[{"href":"https:\/\/notes.coremix.net\/index.php?rest_route=\/wp\/v2\/posts\/335","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/notes.coremix.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/notes.coremix.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/notes.coremix.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/notes.coremix.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=335"}],"version-history":[{"count":3,"href":"https:\/\/notes.coremix.net\/index.php?rest_route=\/wp\/v2\/posts\/335\/revisions"}],"predecessor-version":[{"id":338,"href":"https:\/\/notes.coremix.net\/index.php?rest_route=\/wp\/v2\/posts\/335\/revisions\/338"}],"wp:attachment":[{"href":"https:\/\/notes.coremix.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=335"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/notes.coremix.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=335"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/notes.coremix.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=335"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}