{"id":317243,"date":"2021-02-04T19:44:29","date_gmt":"2021-02-04T11:44:29","guid":{"rendered":"http:\/\/4563.org\/?p=317243"},"modified":"2021-02-04T19:44:29","modified_gmt":"2021-02-04T11:44:29","slug":"%e4%b8%ba%e4%bb%80%e4%b9%88%e4%bc%9a%e6%9c%89%e8%bf%99%e7%a7%8d%e7%b1%bb%e5%9e%8b%e8%bd%ac%e6%8d%a2","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=317243","title":{"rendered":"\u4e3a\u4ec0\u4e48\u4f1a\u6709\u8fd9\u79cd\u7c7b\u578b\u8f6c\u6362"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u4e3a\u4ec0\u4e48\u4f1a\u6709\u8fd9\u79cd\u7c7b\u578b\u8f6c\u6362               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : anzu <\/span>  <span><i><\/i> 5<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<pre><code>    private static Integer getInteger() {         return null;     }      public static void main(String[] args) {         boolean condition = false;         \/\/ error: null pointer exception         Integer i = condition ? 1 : getInteger();         if (Objects.equals(i, 1)) {             System.out.println(\"i == 1\");         } else {             System.out.println(\"i == null\");         }     }  <\/code><\/pre>\n<p>\u4e3a\u4ec0\u4e48\u662f getInteger() \u8fd4\u56de\u503c\u9000\u5316\u6210 int \u800c\u4e0d\u662f 1 \u63d0\u5347\u4e3a Integer \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=\"5085461\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : mgzu <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u7528 JD-GUI \u770b\u5230\u7684\u53cd\u7f16\u8bd1\u7ed3\u679c\u662f<br \/>Integer i = Integer.valueOf(condition ? 1 : getInteger().intValue())                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5085462\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : AoEiuV020 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u8fd8\u771f\u6ca1\u6ce8\u610f\u8fc7\u8fd9\u60c5\u51b5\uff0c\u786e\u5b9e\u6709\u70b9\u4e0d\u53cb\u597d\uff0c\u51fa\u6765\u672c\u6765\u53ef\u4ee5\u907f\u514d\u7684\u7a7a\u6307\u9488\uff0c<br \/>\u4e0d\u8fc7\u4ece\u4e00\u5f00\u59cb\u6211\u8bb0\u5f97\u7684\u5c31\u662f Integer \u53c2\u4e0e\u8fd0\u7b97\u4f1a\u62c6\u7bb1\uff0cint \u53c2\u4e0e\u6cdb\u578b\u4f1a\u88c5\u7bb1\uff0c<br \/>\u5012\u662f\u6ca1\u6709\u8fdd\u53cd\u6211\u7684\u8bb0\u5fc6\uff0c                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5085463\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Bronya <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4e3b\u4f60\u53d1\u7684\u94fe\u63a5\u91cc\uff0cbnp(..) T | bnp(..) lub(..) \u5206\u522b\u662f\u4ec0\u4e48\u610f\u601d\u5440\uff1f<br \/>~~\u7ffb\u8bd1\u4e86\u4e00\u4e0b\u6ca1\u770b\u592a\u660e\u767d                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5085464\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : AoEiuV020 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u554a\u8fd9\uff0c\u6709\u70b9\u5b81\u4fe1\u5ea6\u4e86\uff0c\u4ee3\u7801\u90fd\u8dd1\u8fc7\u4e86\uff0c\u786e\u5b9e\u662f\u62c6\u7bb1\uff0c\u90a3\u8bbe\u8ba1\u4e0a\u5f53\u7136\u5c31\u662f\u62c6\u7bb1\uff0c\u767d\u76ae\u4e66\u5f53\u7136\u5199\u7740\u62c6\u7bb1\uff0c\u4e0d\u770b\u51fa\u77e5\u9053\u5427\uff0c                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u4e3a\u4ec0\u4e48\u4f1a\u6709\u8fd9\u79cd\u7c7b\u578b\u8f6c\u6362 \u8cc7\u6df1\u5927\u4f6c &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\/317243"}],"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=317243"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/317243\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=317243"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=317243"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=317243"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}