{"id":503,"date":"2019-02-15T23:30:17","date_gmt":"2019-02-15T15:30:17","guid":{"rendered":"http:\/\/www.eait.co\/?p=503"},"modified":"2019-04-05T12:32:23","modified_gmt":"2019-04-05T04:32:23","slug":"java%e9%80%9a%e8%bf%87super%e8%b0%83%e7%94%a8%e7%88%b6%e7%b1%bb%e7%9a%84%e5%b1%9e%e6%80%a7%e5%92%8c%e6%96%b9%e6%b3%95%ef%bc%9a","status":"publish","type":"post","link":"https:\/\/notes.coremix.net\/?p=503","title":{"rendered":"java\u901a\u8fc7super\u8c03\u7528\u7236\u7c7b\u7684\u5c5e\u6027\u548c\u65b9\u6cd5\uff1a"},"content":{"rendered":"<pre>import java.util.SplittableRandom;\r\n\r\n\/**\r\n * Created by xabcd on 2019\/2\/15.\r\n *\/\r\npublic class Person7\r\n{\r\n    String name;\r\n    int age;\r\n    public Person7()\r\n    {}\r\n    public String talk(){\r\n        return \"\u6211\u662f\uff1a\"+this.name+\"\uff0c\u4eca\u5e74\uff1a\"+this.age+\"\u5c81\";\r\n    }\r\n\/\/    public Person7(String name,int age){\r\n\/\/        this.name=name;\r\n\/\/        this.age= age;\r\n        \/\/System.out.println(\"1.public Person7(){}\" );\r\n\r\n    }\r\n\r\nclass Studenttt extends Person7 {\r\n    String school;\r\n\r\n    public Studenttt(String name, int age, String school) {\r\n        super.name = name;\r\n        super.age = age;\r\n        System.out.print(super.talk());\r\n        this.school = school;\r\n\r\n        \/\/\u5728\u8fd9\u91cc\u8c03\u7528\u7236\u7c7b\u7684\u6784\u9020\u65b9\u6cd5\r\n\/\/        super(\"\u5f20\u4e09\",25);\r\n        \/\/System.out.println(\"2.public Student(){}\");\r\n    }\r\n\r\n}\r\n\r\n\r\n\r\n\r\n\r\n<\/pre>\n<pre>public class testjicheng2 {\r\n    public static void main(String[] args) {\r\n        Studenttt s = new Studenttt(\"\u5f20\u4e09\", 25, \"\u5317\u4eac\");\r\n\/\/        s.school= \"\u5317\u4eac\";\r\n        System.out.println(\"\uff0c\u5b66\u6821\uff1a\" + s.school);\r\n\/\/        System.out.println(\"\u59d3\u540d\uff1a\"+s.name+\"\uff0c\u5e74\u9f84\"+s.age+\"\uff0c\u5b66\u6821\uff1a\"+s.school);\r\n\r\n    }\r\n}\r\n\r\n\r\n\r\n\u7ed3\u679c\uff1a\r\n\u6211\u662f\uff1a\u5f20\u4e09\uff0c\u4eca\u5e74\uff1a25\u5c81\uff0c\u5b66\u6821\uff1a\u5317\u4eac\r\n\r\n\r\n\r\n\r\n<\/pre>\n<p>\u65b9\u6cd5\u3002 \u4f46\u662f \u7ec6\u5fc3 \u7684 \u8bfb\u8005 \u5728 \u672c\u4f8b \u4e2d \u53ef\u4ee5 \u53d1\u73b0\uff0c \u5982\u679c \u7b2c 21\u3001 22\u3001 25 \u884c \u6362\u6210 this \u8c03\u7528 \u4e5f\u662f \u53ef\u4ee5 \u7684\uff0c \u90a3 \u4e3a\u4ec0\u4e48 \u8fd8\u8981 \u7528 super \u5462\uff1f \u8bfb\u8005 \u770b\u5b8c \u4e0b\u9762 \u7684 \u5185\u5bb9 \u5c31\u53ef\u4ee5 \u77e5\u9053 \u4ec0\u4e48\u65f6\u5019 \u5e94\u8be5 \u8fd9\u6837 \u4f7f\u7528\u3002<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>import java.util.SplittableRandom; \/** * Created by xab [&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-503","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\/503","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=503"}],"version-history":[{"count":2,"href":"https:\/\/notes.coremix.net\/index.php?rest_route=\/wp\/v2\/posts\/503\/revisions"}],"predecessor-version":[{"id":505,"href":"https:\/\/notes.coremix.net\/index.php?rest_route=\/wp\/v2\/posts\/503\/revisions\/505"}],"wp:attachment":[{"href":"https:\/\/notes.coremix.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=503"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/notes.coremix.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=503"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/notes.coremix.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=503"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}