{"id":192443,"date":"2020-11-10T00:51:18","date_gmt":"2020-11-09T16:51:18","guid":{"rendered":"http:\/\/4563.org\/?p=192443"},"modified":"2020-11-10T00:51:18","modified_gmt":"2020-11-09T16:51:18","slug":"%e5%88%86%e4%ba%ab%e4%b8%80%e4%b8%aa%e5%85%b3%e4%ba%8e%e5%8d%8f%e5%8f%98%e3%80%81%e9%80%86%e5%8f%98%e3%80%81%e4%b8%8d%e5%8f%98%e7%9a%84%e4%bc%98%e7%a7%80%e5%9b%9e%e7%ad%94","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=192443","title":{"rendered":"\u5206\u4eab\u4e00\u4e2a\u5173\u4e8e\u534f\u53d8\u3001\u9006\u53d8\u3001\u4e0d\u53d8\u7684\u4f18\u79c0\u56de\u7b54"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u5206\u4eab\u4e00\u4e2a\u5173\u4e8e\u534f\u53d8\u3001\u9006\u53d8\u3001\u4e0d\u53d8\u7684\u4f18\u79c0\u56de\u7b54               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : JasonLaw <\/span>  <span><i><\/i> 8<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u4e4b\u524d\u5bf9\u4e8e\u8fd9\u51e0\u4e2a\u6982\u5ff5\u6ca1\u6709\u4e00\u4e2a\u6df1\u5165\u7684\u7406\u89e3\uff0c\u8fd9\u4e2a\u56de\u7b54\u771f\u7684\u89e3\u91ca\u5f97\u592a\u597d\u4e86\u3002<\/p>\n<p>\u5173\u4e8e\u6570\u7ec4\u662f\u534f\u53d8\u7684\uff0cJon Skeet \u5728Is List&lt;Dog&gt; a subclass of List&lt;Animal&gt;? Why are Java generics not implicitly polymorphic? &#8211; Stack Overflow\u4e2d\u6709\u8fd9\u4e48\u4e00\u4e2a\u8bc4\u8bba\u3002<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>5<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"4151303\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : sunjourney <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u8fd9\u4e0d\u7b97\u89e3\u91ca\u5427\uff0c\u539f\u56e0\u5728\u4e8e\u6570\u636e\u662f\u5426\u6709\u53ef\u53d8\u6027                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4151304\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : no1xsyzy <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u53ea\u6709\u5c06\u7c7b\u578b\u4f5c\u4e3a\u53c2\u91cf\uff08\u5305\u62ec\u6cdb\u578b\uff09\u624d\u6709\u534f\u53d8\u9006\u53d8\u4e4b\u8bf4<br \/>\u5047\u5b9a\u4e00\u4e2a\u51fd\u6570\u7b7e\u540d\u4e3a f: A -&gt; B<br \/>A \u5bf9\u4e8e f \u662f\u9006\u53d8\u7684\uff0c\u56e0\u4e3a\u5bf9\u4e8e\u4efb\u4f55 A \u7684\u7236\u7c7b C\uff0cg: C -&gt; B \u53ef\u4ee5\u548c f \u4e00\u6837\u88ab\u4f7f\u7528<br \/>B \u5bf9\u4e8e f \u662f\u534f\u53d8\u7684\uff0c\u56e0\u4e3a\u5bf9\u4e8e\u4efb\u4f55 B \u7684\u5b50\u7c7b D\uff0ch: A -&gt; D \u53ef\u4ee5\u548c f \u4e00\u6837\u88ab\u4f7f\u7528<br \/>\u800c\u5982\u679c\u662f List \u8fd9\u4e2a\u5177\u6709\u6cdb\u578b\u7684\u7c7b\uff0c\u56e0\u4e3a\u5b83\u7684 \u201c\u8303\u7574\u201d\uff08\u8bb0\u5f97\u9762\u5411\u5bf9\u8c61\u662f\u8303\u7574\u8bba\u7684\u8fd1\u4f3c\uff09\u65e2\u5305\u542b\u4e86\u5217\u8868\u53d6\u5143\u7d20\u7684 ref: A[] -&gt; A\uff0c\u53c8\u5305\u542b\u4e86\u5143\u7d20\u6784\u9020\u5217\u8868\u7684 list: A -&gt; A[]\uff0c\u751a\u81f3\u5305\u542b\u4e86\u5c3e\u90e8\u6dfb\u52a0\u5143\u7d20\u7684 append: A[] -&gt; A -&gt; A[] \u548c\u5934\u90e8\u6dfb\u52a0\u5143\u7d20\u7684 prepend: A -&gt; A[] -&gt; A[]\uff0c\u90a3 A \u5bf9\u4e8e A[] \u65e2\u4e0d\u603b\u662f\u534f\u53d8\u7684\uff0c\u4e5f\u4e0d\u603b\u662f\u9006\u53d8\u7684\uff0c\u90a3\u5c31\u662f\u4e0d\u53d8\u7684\u3002<\/p>\n<p>\u800c\u5373\u4f7f\u5e95\u5c42\u5b9e\u73b0\u4e86\u7c7b\u4f3c\u7684\u7ed3\u6784\uff0c\u5982\u679c\u662f\u53ea\u51fa\u4e0d\u8fdb\u7684\u961f\u5217\uff0c\u90a3 A \u5bf9\u4e8e QueueOut \u662f\u534f\u53d8\u7684\uff0c\u53ea\u8fdb\u4e0d\u51fa\u7684\u961f\u5217\uff0cA \u5bf9\u4e8e QueueIn \u662f\u9006\u53d8\u7684\u3002<br \/>\uff08\u8fd9\u4f3c\u4e4e\u548c traits \u6709\u70b9\u7c7b\u4f3c\uff1f\u63a5\u53e3\u7684\u67d0\u4e9b\u5b50\u96c6\u8fbe\u6210\u534f\u53d8\uff0c\u67d0\u4e9b\u5b50\u96c6\u8fbe\u6210\u9006\u53d8\uff0c\u5408\u5728\u4e00\u8d77\u5c31\u6210\u4e86\u4e0d\u53d8\uff09<\/p>\n<p>\u6574\u5957 OO \u4f53\u7cfb\u662f\u6df7\u4e71\u7684\u3002<br \/>\u6ee5\u7528\u7ee7\u627f\u3002<br \/>\u5e0c\u671b\u6765\u70b9\u53ea\u80fd\u8fdb\u884c\u5305\u88f9\u3001\u9759\u6001\u9e2d\u5b50\u8bed\u8a00\u7684 OO \u8bed\u8a00\u3002<br \/>\u987a\u4fbf\u8fd9\u9700\u8981\u8bed\u6cd5\u7cd6\u6765\u5feb\u901f\u5b9e\u73b0 this.some_method = this.wrapped_object.method<br \/>`convey wrapped_object.method as some_method`                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4151305\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : JasonLaw <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @sunjourney #1 \u6570\u636e\u662f\u5426\u6709\u53ef\u53d8\u6027\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4151306\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : JasonLaw <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @no1xsyzy #2 \u5b8c\u5168\u770b\u4e0d\u61c2\u4f60\u6240\u8bf4\u7684                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4151307\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : aguesuka <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u65e2\u7136\u9009\u62e9\u4e86 java \u5c31\u4e0d\u8981\u7ea0\u7ed3\u8fd9\u79cd\u4e1c\u897f\uff0cjava \u4e0d\u662f\u4f9d\u8d56\u7c7b\u578b\u7684\u8bed\u8a00\u3002\u6cdb\u578b\u8fb9\u754c\u662f\u5bf9\u4ee3\u7801\u53ef\u8bfb\u6027\u7684\u6bc1\u706d\u6253\u51fb                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u5206\u4eab\u4e00\u4e2a\u5173\u4e8e\u534f\u53d8\u3001\u9006\u53d8\u3001\u4e0d\u53d8\u7684\u4f18\u79c0&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/192443"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=192443"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/192443\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=192443"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=192443"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=192443"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}