{"id":467,"date":"2019-02-14T23:01:37","date_gmt":"2019-02-14T15:01:37","guid":{"rendered":"http:\/\/www.eait.co\/?p=467"},"modified":"2019-04-05T12:32:51","modified_gmt":"2019-04-05T04:32:51","slug":"java%e6%9e%84%e9%80%a0%e6%96%b9%e6%b3%95%ef%bc%88%e6%9c%89%e5%8f%82%e5%92%8c%e6%97%a0%e5%8f%82%e6%b3%a8%e6%84%8f%e4%ba%8b%e9%a1%b9%ef%bc%89%ef%bc%9a","status":"publish","type":"post","link":"https:\/\/notes.coremix.net\/?p=467","title":{"rendered":"java\u6784\u9020\u65b9\u6cd5\uff08\u6709\u53c2\u548c\u65e0\u53c2\u6ce8\u610f\u4e8b\u9879\uff09\uff1a"},"content":{"rendered":"<pre>\/**\r\n * Created by xabcd on 2019\/2\/14.\r\n *\/\r\npublic class Person4\r\n{\r\n    private String name;\r\n    private  int age;\r\n    public  Person4(String n,int a)\/\/\u5c06\u4f20\u5165\u7684\u503c\u8d4b\u7ed9Person3\u7684\u5c5e\u6027\uff0c\u5373\u4e0a\u9762\u4e24\u884c\r\n    {\r\n        name = n;\r\n        age = a;\r\n        System.out.println(\"plblic Person(String n,int a)\");\r\n    }\r\n    public String talk()\r\n    {\r\n        return \"\u6211\u662f\uff1a\"+name+\",\u4eca\u5e74\uff1a\"+age+\"\u5c81\";\r\n    }\r\n    public static void main(String[] args)\r\n    {\r\n        Person4 p = new Person4();\/\/<span style=\"color: #ff0000;\">\u6b64\u5904\u4e00\u5b9a\u8981\u4f20\u9012\u53c2\u6570\u8fdb\u53bb\uff0c\u5426\u5219\u62a5\u9519\uff01<\/span>\r\n        System.out.println(p.talk());\r\n    }\r\n}\r\n\r\n\r\n\r\n\r\n\r\n<\/pre>\n<pre>\/**\r\n * Created by xabcd on 2019\/2\/14.\r\n *\/\r\npublic class Person4\r\n{\r\n    private String name =\"\u6211\";\r\n    private  int age =22;\r\n    public  Person4()\/\/\u5c06\u4f20\u5165\u7684\u503c\u8d4b\u7ed9Person3\u7684\u5c5e\u6027\uff0c\u5373\u4e0a\u9762\u4e24\u884c\r\n    {\r\n;\r\n        System.out.println(\"plblic Person(String n,int a)\");\r\n    }\r\n    public String talk()\r\n    {\r\n        return \"\u6211\u662f\uff1a\"+name+\",\u4eca\u5e74\uff1a\"+age+\"\u5c81\";\r\n    }\r\n    public static void main(String[] args)\r\n    {\r\n        Person4 p = new Person4();\r\n        System.out.println(p.talk());\r\n    }\r\n}\r\n<span style=\"color: #ff0000;\">\/\/\u5220\u9664\u53c2\u6570\u540e\u8fd0\u884c\u6210\u529f\r\n\r\n\u7ed3\u679c\uff1a\r\n \u6211\u662f\uff1a\u6211,\u4eca\u5e74\uff1a22\u5c81\r\n\r\n\r\n\r\n\u540e\u9762\u58f0\u660e\u4e00\u884c\u65e0\u53c2\u4ee3\u7801\u4e5f\u53ef\uff1a\r\npublic Person4\uff08\uff09\r\n{}\r\n\r\n\u8fd0\u884c\u7ed3\u679c\uff1a\r\n \u6211\u662f\uff1anull,\u4eca\u5e74\uff1a0\u5c81\r\n<\/span><\/pre>\n<p>\u5728 \u7f16\u8bd1\u7a0b\u5e8f \u7b2c 21 \u884c\uff08 Person p = new Person()\uff09 \u65f6 \u53d1\u751f\u4e86 \u9519\u8bef\uff0c \u8fd9\u4e2a \u9519\u8bef \u8bf4 \u627e \u4e0d\u5230 Person \u7c7b \u7684 \u65e0 \u53c2 \u6784\u9020 \u65b9\u6cd5\u3002 \u5728\u524d\u9762 \u66fe\u7ecf \u63d0 \u8fc7\uff0c \u5982\u679c \u7a0b\u5e8f \u4e2d \u6ca1\u6709 \u58f0\u660e \u6784\u9020 \u65b9\u6cd5\uff0c \u7a0b\u5e8f \u5c31\u4f1a \u81ea\u52a8 \u58f0\u660e \u4e00\u4e2a \u65e0 \u53c2 \u7684 \u4e14 \u4ec0\u4e48 \u90fd \u4e0d\u505a \u7684 \u6784\u9020 \u65b9\u6cd5\uff0c \u53ef\u662f \u73b0\u5728 \u5374 \u53d1\u751f\u4e86 \u627e \u4e0d\u5230 \u65e0 \u53c2 \u6784\u9020 \u65b9\u6cd5 \u7684 \u95ee\u9898\uff0c \u8fd9\u662f \u4e3a\u4ec0\u4e48\uff1f \u8bfb\u8005 \u53ef\u4ee5 \u53d1\u73b0 \u7b2c 5 \uff5e 10 \u884c \u5df2\u7ecf \u58f0\u660e \u4e86 \u4e00\u4e2a \u542b\u6709 \u4e24\u4e2a \u53c2\u6570 \u7684 \u6784\u9020 \u65b9\u6cd5\u3002 \u5728 Java \u7a0b\u5e8f \u4e2d \u53ea\u8981 \u660e\u786e \u5730 \u58f0\u660e \u4e86 \u6784\u9020 \u65b9\u6cd5\uff0c \u90a3\u4e48 \u9ed8\u8ba4 \u7684 \u6784\u9020 \u65b9\u6cd5 \u5c31\u4e0d \u4f1a\u88ab \u81ea\u52a8 \u751f\u6210\u3002 \u800c\u8981 \u89e3\u51b3 \u8fd9\u4e00 \u95ee\u9898\uff0c \u53ea\u9700 \u8981 \u7b80\u5355 \u5730 \u4fee\u6539 \u4e00\u4e0b Person \u7c7b \u5c31\u53ef\u4ee5 \u4e86\uff0c \u53ef\u4ee5 \u5728 Person \u7c7b \u4e2d \u660e\u786e \u5730 \u58f0\u660e \u4e00\u65e0 \u53c2 \u7684 \u4e14 \u4ec0\u4e48 \u90fd \u4e0d\u505a \u7684 \u6784\u9020 \u65b9\u6cd5\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\/** * Created by xabcd on 2019\/2\/14. *\/ public class Pe [&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-467","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\/467","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=467"}],"version-history":[{"count":4,"href":"https:\/\/notes.coremix.net\/index.php?rest_route=\/wp\/v2\/posts\/467\/revisions"}],"predecessor-version":[{"id":471,"href":"https:\/\/notes.coremix.net\/index.php?rest_route=\/wp\/v2\/posts\/467\/revisions\/471"}],"wp:attachment":[{"href":"https:\/\/notes.coremix.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=467"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/notes.coremix.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=467"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/notes.coremix.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=467"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}