{"id":418708,"date":"2021-03-14T03:12:01","date_gmt":"2021-03-13T19:12:01","guid":{"rendered":"http:\/\/4563.org\/?p=418708"},"modified":"2021-03-14T03:12:01","modified_gmt":"2021-03-13T19:12:01","slug":"%e7%ae%80%e5%8d%95%e7%9a%84-lambda-%e8%a1%a8%e8%be%be%e5%bc%8f%e6%b1%82%e5%8a%a9","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=418708","title":{"rendered":"\u7b80\u5355\u7684 lambda \u8868\u8fbe\u5f0f\u6c42\u52a9"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u7b80\u5355\u7684 lambda \u8868\u8fbe\u5f0f\u6c42\u52a9               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : lithium148 <\/span>  <span><i><\/i> 2<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<pre><code>\/\/\u533f\u540d\u5185\u90e8\u7c7b\uff1a Runnable r = new Runnable() {             @Override             public void run() {                              }         };                   \/\/\u6539\u5199\u6210 lambda \u8868\u8fbe\u5f0f\uff1a Runnable r = new Runnable(()-&gt;{});  \u65e0\u6cd5\u901a\u8fc7\u7f16\u8bd1\uff0c\u63d0\u793a\u201c'Runnable' is abstract; cannot be instantiated\u201d   \u8bf7\u95ee\u95ee\u9898\u51fa\u5728\u54ea\uff0c\u975e\u5e38\u611f\u8c22~<\/code><\/pre>\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=\"5581156\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : nthin0 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             Runnable r = () -&gt; {};                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5581157\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : lithium148 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @nthin0 \u8c22\u8c22\u5927\u4f6c\uff0c\u4f46\u662f\u4e3a\u5565\u4e0d\u7528\u5199 new runnable()\u554a                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5581158\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : ninjachen <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u56e0\u4e3a\u5b83\u4e0d\u662f lambda \u8868\u8fbe\u5f0f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5581159\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : brust <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             Runnable r = ()-&gt;{};<br \/>Thread t = new Thread(new Runnable() {<br \/> @Override<br \/> public void run() {<\/p>\n<p> }<br \/> });<br \/>Thread t = new Thread(()-&gt;{});                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5581160\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : beichenhpy <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4e0d\u7528\u52a0 new \u4e86\u5427 ()-&gt;{}\u5c31\u662f new \u4e86                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u7b80\u5355\u7684 lambda \u8868\u8fbe\u5f0f\u6c42\u52a9 &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\/418708"}],"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=418708"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/418708\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=418708"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=418708"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=418708"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}