{"id":386585,"date":"2021-03-11T14:50:58","date_gmt":"2021-03-11T06:50:58","guid":{"rendered":"http:\/\/4563.org\/?p=386585"},"modified":"2021-03-11T14:50:58","modified_gmt":"2021-03-11T06:50:58","slug":"rxjava-%e4%b8%ad-function-%e6%98%af%e5%a6%82%e4%bd%95%e5%ae%9e%e7%8e%b0%e7%9a%84%ef%bc%9f","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=386585","title":{"rendered":"RxJAVA \u4e2d Function \u662f\u5982\u4f55\u5b9e\u73b0\u7684\uff1f"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  RxJAVA \u4e2d Function \u662f\u5982\u4f55\u5b9e\u73b0\u7684\uff1f               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : 101110001 <\/span>  <span><i><\/i> 7<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u521b\u5efa Function \u5bf9\u8c61\u65f6\u4e0d\u662f Function() ,\u800c\u662f Function{}<\/p>\n<pre><code>Function&lt;Int,String&gt; { inVal -&gt;  [email&#160;protected] \"string\" } <\/code><\/pre>\n<p>\u4e14\u53ef\u4ee5\u8c03\u7528\u5916\u90e8\u51fd\u6570<\/p>\n<pre><code>Function&lt;Int,String&gt; { inVal -&gt;  [email&#160;protected] staticStringVal() }   fun staticStringVal(): String {  return \"string\" } <\/code><\/pre>\n<p>\u770b\u4e86\u597d\u4e45\u6e90\u7801\uff0c\u6123\u662f\u770b\u4e0d\u61c2\uff0c\u80fd\u5426\u6709\u5927\u4f6c\u89e3\u91ca\u4e00\u4e0b\uff1f<\/p>\n<p>\u5982\u56fe\uff0c\u5de6\u8fb9\u662f rxjava \u6e90\u7801\u4e2d\u7684\u4e00\u90e8\u5206,\u53f3\u8fb9\u662f\u4f7f\u7528\u793a\u4f8b <img decoding=\"async\" loading=\"lazy\" referrerpolicy=\"no-referrer\" rel=\"noreferrer\" src=\"http:\/\/4563.org\/wp-content\/uploads\/2021\/03\/20210312_604abaff27d56.png\" alt=\"RxJAVA \u4e2d Function \u662f\u5982\u4f55\u5b9e\u73b0\u7684\uff1f\" \/><\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>4<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"5393222\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : kassadin <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             kotlin \u7684\u8bed\u6cd5\u7cd6 SAM\uff0c\u53ef\u4ee5\u7528 lambda \u7b80\u5199\u3002single abstract method interface\uff0c\u5927\u6982\u662f\u8fd9\u4e48\u62fc\u7684\u5427                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5393223\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Kasumi20 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u800c\u4e14\u8fd8\u4e0d\u7528 new \u5173\u952e\u5b57\u5462\uff0c\u8fd9\u662f Kotlin \u9e2d\u4e0d\u662f Java                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5393224\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : LGA1150 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                              \/go\/kotlin                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5393225\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : DiDiz <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5c31\u662f\u4e2a\u7f16\u8bd1\u5668\u9b54\u6cd5\u800c\u5df2\uff0c\u548c\u4f60\u7528 Java \u5199\u533f\u540d\u5185\u90e8\u7c7b\u662f\u4e00\u56de\u4e8b<br \/>&#8220;`<br \/>Function&lt;Integer, String&gt; func = new Function&lt;Integer, String&gt;() {<br \/> @Override<br \/> public String apply(Integer t) {<br \/> &#8230;<br \/> }<br \/>}<br \/>&#8220;`                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>RxJAVA \u4e2d Function&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\/386585"}],"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=386585"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/386585\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=386585"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=386585"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=386585"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}