{"id":55835,"date":"2025-08-14T08:54:42","date_gmt":"2025-08-14T00:54:42","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/55835.html"},"modified":"2025-08-14T08:54:42","modified_gmt":"2025-08-14T00:54:42","slug":"java%e5%ad%a6%e4%b9%a0%e7%ac%ac%e4%b8%80%e7%99%be%e4%b8%89%e5%8d%81%e4%ba%94%e9%83%a8%e5%88%86-%e8%87%aa%e5%8a%a8%e8%a3%85%e7%ae%b1-%e6%8b%86%e7%ae%b1%e7%9a%84npe%e9%a3%8e%e9%99%a9","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/55835.html","title":{"rendered":"Java\u5b66\u4e60\u7b2c\u4e00\u767e\u4e09\u5341\u4e94\u90e8\u5206\u2014\u2014\u81ea\u52a8\u88c5\u7bb1\/\u62c6\u7bb1\u7684NPE\u98ce\u9669"},"content":{"rendered":"<p id=\"main-toc\">\u76ee\u5f55<\/p>\n<p id=\"%E4%B8%80%E3%80%81%E5%89%8D%E8%A8%80%E7%AE%80%E4%BB%8B-toc\" style=\"margin-left:0px\">\u4e00\u3001\u524d\u8a00\u7b80\u4ecb<\/p>\n<p id=\"%E4%BA%8C%E3%80%81%E7%9B%B8%E5%85%B3%E5%AE%9A%E4%B9%89-toc\" style=\"margin-left:0px\">\u4e8c\u3001\u76f8\u5173\u5b9a\u4e49<\/p>\n<p id=\"%E4%B8%89%E3%80%81%E8%87%AA%E5%8A%A8%E6%8B%86%E7%AE%B1%E7%9A%84NPE%E9%A3%8E%E9%99%A9-toc\" style=\"margin-left:0px\">\u4e09\u3001\u81ea\u52a8\u62c6\u7bb1\u7684NPE\u98ce\u9669<\/p>\n<p id=\"%E5%9B%9B%E3%80%81%E9%A3%8E%E9%99%A9%E6%88%90%E5%9B%A0-toc\" style=\"margin-left:0px\">\u56db\u3001\u98ce\u9669\u6210\u56e0<\/p>\n<p id=\"%E4%BA%94%E3%80%81%E9%A3%8E%E9%99%A9%E9%81%BF%E5%85%8D-toc\" style=\"margin-left:0px\">\u4e94\u3001\u98ce\u9669\u907f\u514d<\/p>\n<p id=\"%E5%85%AD%E3%80%81%E5%8F%AF%E8%83%BD%E5%9C%BA%E6%99%AF-toc\" style=\"margin-left:0px\">\u516d\u3001\u53ef\u80fd\u573a\u666f<\/p>\n<p id=\"%E4%B8%83%E3%80%81%E6%80%BB%E7%BB%93%E5%BD%92%E7%BA%B3-toc\" style=\"margin-left:0px\">\u4e03\u3001\u603b\u7ed3\u5f52\u7eb3<\/p>\n<hr id=\"hr-toc\" \/>\n<h2 style=\"background-color:transparent\">\u4e00\u3001\u524d\u8a00\u7b80\u4ecb<\/h2>\n<p>\u00a0 \u00a0 \u00a0 \u00a0\u5728Java\u4e2d&#xff0c;\u81ea\u52a8\u88c5\u7bb1&#xff08;autoboxing&#xff09;\u548c\u81ea\u52a8\u62c6\u7bb1&#xff08;unboxing&#xff09;\u662fJava\u8bed\u8a00\u4e3a\u4e86\u65b9\u4fbf\u5f00\u53d1\u800c\u5f15\u5165\u7684\u7279\u6027&#xff0c;\u4f46\u5b83\u4eec\u4e5f\u53ef\u80fd\u5e26\u6765\u4e00\u4e9b\u6f5c\u5728\u7684\u98ce\u9669\u5982\u7a7a\u6307\u9488\u5f02\u5e38&#xff08;NullPointerException&#xff0c;\u7b80\u79f0NPE&#xff09;\u3002<\/p>\n<h2 id=\"%E4%BA%8C%E3%80%81%E7%9B%B8%E5%85%B3%E5%AE%9A%E4%B9%89\" style=\"background-color:transparent\">\u4e8c\u3001\u76f8\u5173\u5b9a\u4e49<\/h2>\n<p><span style=\"color:#956fe7\">\u81ea\u52a8\u88c5\u7bb1&#xff08;Autoboxing&#xff09;&#xff1a;<\/span><\/p>\n<p>\u5c06\u57fa\u672c\u6570\u636e\u7c7b\u578b&#xff08;\u5982&#096;int&#096;&#xff09;\u81ea\u52a8\u8f6c\u6362\u4e3a\u5bf9\u5e94\u7684\u5305\u88c5\u7c7b&#xff08;\u5982&#096;Integer&#096;&#xff09;\u3002\u4f8b\u5982&#xff1a;<\/p>\n<p>\u00a0 Integer num &#061; 10; \/\/ \u81ea\u52a8\u88c5\u7bb1 <\/p>\n<p><span style=\"color:#956fe7\">\u81ea\u52a8\u62c6\u7bb1&#xff08;Unboxing&#xff09;&#xff1a;<\/span><\/p>\n<p>\u5c06\u5305\u88c5\u7c7b&#xff08;\u5982&#096;Integer&#096;&#xff09;\u81ea\u52a8\u8f6c\u6362\u4e3a\u5bf9\u5e94\u7684\u57fa\u672c\u6570\u636e\u7c7b\u578b&#xff08;\u5982&#096;int&#096;&#xff09;\u3002\u4f8b\u5982&#xff1a;<\/p>\n<p>\u00a0 Integer num &#061; 10;<br \/>\n\u00a0 int n &#061; num; \/\/ \u81ea\u52a8\u62c6\u7bb1 <\/p>\n<h2 id=\"%E4%B8%89%E3%80%81%E8%87%AA%E5%8A%A8%E6%8B%86%E7%AE%B1%E7%9A%84NPE%E9%A3%8E%E9%99%A9\" style=\"background-color:transparent\">\u4e09\u3001\u98ce\u9669\u8bf4\u660e<\/h2>\n<ul>\n<li>\n<p>\u9996\u5148&#xff0c;<span style=\"color:#fe2c24\">\u81ea\u52a8\u88c5\u7bb1<\/span>\u672c\u8eab\u4e0d\u4f1a\u5bfc\u81f4NPE&#xff0c;\u6216\u8005\u8bf4<span style=\"color:#fe2c24\">\u81ea\u52a8\u88c5\u7bb1<\/span>\u4e0d\u5b58\u5728NPE\u98ce\u9669\u3002\u56e0\u4e3a\u81ea\u52a8\u88c5\u7bb1\u662f\u5c06\u57fa\u672c\u6570\u636e\u7c7b\u578b\u8f6c\u6362\u4e3a\u5bf9\u5e94\u7684\u5305\u88c5\u7c7b\u5bf9\u8c61&#xff0c;\u800c\u57fa\u672c\u6570\u636e\u7c7b\u578b\u672c\u8eab\u4e0d\u4f1a\u4e3anull\u3002<\/p>\n<\/li>\n<li>\n<p>\u7136\u800c&#xff0c;<span style=\"color:#fe2c24\">\u81ea\u52a8\u88c5\u7bb1<\/span>\u53ef\u80fd\u4f1a\u95f4\u63a5\u5bfc\u81f4NPE\u98ce\u9669&#xff0c;\u5c24\u5176\u662f\u5728\u4e0e\u81ea\u52a8\u62c6\u7bb1\u7ed3\u5408\u4f7f\u7528\u65f6\u3002\u4f46\u5f53\u81ea\u52a8\u88c5\u7bb1\u7684\u5bf9\u8c61\u88ab\u540e\u7eed\u7684\u81ea\u52a8\u62c6\u7bb1\u64cd\u4f5c\u4f7f\u7528\u65f6&#xff0c;\u5982\u679c\u5bf9\u8c61\u4e3anull&#xff0c;\u5c31\u4f1a\u5f15\u53d1NPE\u3002<\/p>\n<\/li>\n<li>\n<p>\u4e3a\u4e86\u907f\u514d\u8fd9\u79cd\u98ce\u9669&#xff0c;\u5efa\u8bae\u5728<span style=\"color:#fe2c24\">\u81ea\u52a8\u62c6\u7bb1<\/span>\u4e4b\u524d\u68c0\u67e5\u5bf9\u8c61\u662f\u5426\u4e3anull&#xff0c;\u6216\u8005\u5c3d\u91cf\u4f7f\u7528\u57fa\u672c\u6570\u636e\u7c7b\u578b\u800c\u4e0d\u662f\u5305\u88c5\u7c7b\u3002<\/p>\n<\/li>\n<li>\n<p>\u5f53\u4e00\u4e2a\u5305\u88c5\u7c7b\u5bf9\u8c61\u4e3a&#096;null&#096;\u65f6&#xff0c;<span style=\"color:#fe2c24\">\u81ea\u52a8\u62c6\u7bb1<\/span>\u4f1a\u5bfc\u81f4\u7a7a\u6307\u9488\u5f02\u5e38&#xff08;NullPointerException&#xff09;\u3002\u8fd9\u662f\u56e0\u4e3a\u81ea\u52a8\u62c6\u7bb1\u672c\u8d28\u4e0a\u662f\u8c03\u7528\u5305\u88c5\u7c7b\u7684&#096;intValue()&#096;\u65b9\u6cd5&#xff0c;\u800c&#096;null&#096;\u5bf9\u8c61\u65e0\u6cd5\u8c03\u7528\u4efb\u4f55\u65b9\u6cd5\u3002\u6240\u4ee5\u8bf4&#xff0c;<span style=\"color:#fe2c24\">\u81ea\u52a8\u62c6\u7bb1<\/span><span style=\"color:#333333\">\u5b58\u5728<\/span>NPE\u98ce\u9669\u3002<\/p>\n<\/li>\n<\/ul>\n<p><span style=\"color:#956fe7\">\u793a\u4f8b\u4ee3\u7801&#xff1a;<\/span><\/p>\n<p>Integer num &#061; null;<br \/>\nint n &#061; num; \/\/ \u8fd0\u884c\u65f6\u629b\u51faNullPointerException <\/p>\n<p><span style=\"color:#956fe7\">\u539f\u56e0\u5206\u6790&#xff1a;<\/span><\/p>\n<ul>\n<li>\n<p>\u5728\u81ea\u52a8\u62c6\u7bb1\u8fc7\u7a0b\u4e2d&#xff0c;&#096;Integer num&#096;\u4f1a\u88ab\u9690\u5f0f\u5730\u8c03\u7528&#096;num.intValue()&#096;\u65b9\u6cd5\u3002<\/p>\n<\/li>\n<li>\n<p>\u5982\u679c&#096;num&#096;\u4e3a&#096;null&#096;&#xff0c;\u90a3\u4e48&#096;num.intValue()&#096;\u5c31\u4f1a\u629b\u51fa&#096;NullPointerException&#096;\u3002<\/p>\n<\/li>\n<\/ul>\n<h2 id=\"%E5%9B%9B%E3%80%81%E9%A3%8E%E9%99%A9%E6%88%90%E5%9B%A0\" style=\"background-color:transparent\">\u56db\u3001\u98ce\u9669\u6210\u56e0<\/h2>\n<ul>\n<li>\n<p><span style=\"color:#956fe7\">\u5305\u88c5\u7c7b\u4e0e\u57fa\u672c\u6570\u636e\u7c7b\u578b\u7684\u533a\u522b&#xff1a;<\/span>\u5305\u88c5\u7c7b&#xff08;\u5982&#096;Integer&#096;&#xff09;\u662f\u5bf9\u8c61&#xff0c;\u53ef\u4ee5\u4e3a&#096;null&#096;&#xff0c;\u800c\u57fa\u672c\u6570\u636e\u7c7b\u578b&#xff08;\u5982&#096;int&#096;&#xff09;\u4e0d\u80fd\u4e3a&#096;null&#096;&#xff0c;\u5176\u9ed8\u8ba4\u503c\u662f&#096;0&#096;\u3002<\/p>\n<\/li>\n<li>\n<p><span style=\"color:#956fe7\">\u81ea\u52a8\u62c6\u7bb1\u7684\u9690\u5f0f\u8c03\u7528&#xff1a;<\/span>\u81ea\u52a8\u62c6\u7bb1\u662f\u901a\u8fc7\u8c03\u7528\u5305\u88c5\u7c7b\u7684&#096;intValue()&#096;\u65b9\u6cd5\u5b9e\u73b0\u7684\u3002\u5982\u679c\u5bf9\u8c61\u4e3a&#096;null&#096;&#xff0c;\u8c03\u7528\u4efb\u4f55\u65b9\u6cd5\u90fd\u4f1a\u5bfc\u81f4&#096;NullPointerException&#096;\u3002<\/p>\n<\/li>\n<\/ul>\n<h2 id=\"%E4%BA%94%E3%80%81%E9%A3%8E%E9%99%A9%E9%81%BF%E5%85%8D\" style=\"background-color:transparent\">\u4e94\u3001\u98ce\u9669\u907f\u514d<\/h2>\n<p>\u00a0 \u00a0 \u00a0 \u00a0\u4e3a\u4e86\u907f\u514d\u8fd9\u79cdNPE\u98ce\u9669&#xff0c;\u53ef\u4ee5\u5728\u81ea\u52a8\u62c6\u7bb1\u4e4b\u524d\u68c0\u67e5\u5bf9\u8c61\u662f\u5426\u4e3a&#096;null&#096;\u3002<\/p>\n<p>Integer num &#061; null;<br \/>\nif (num !&#061; null) {<br \/>\n\u00a0 \u00a0 int n &#061; num; \/\/ \u5b89\u5168\u7684\u81ea\u52a8\u62c6\u7bb1<br \/>\n} else {<br \/>\n\u00a0 \u00a0 \/\/ \u5904\u7406num\u4e3anull\u7684\u60c5\u51b5<br \/>\n\u00a0 \u00a0 System.out.println(&#034;num is null&#034;);<br \/>\n} <\/p>\n<h2 id=\"%E5%85%AD%E3%80%81%E5%8F%AF%E8%83%BD%E5%9C%BA%E6%99%AF\" style=\"background-color:transparent\">\u516d\u3001\u53ef\u80fd\u573a\u666f<\/h2>\n<p>ps&#xff1a;\u9664\u4e86\u76f4\u63a5\u8d4b\u503c&#xff0c;\u81ea\u52a8\u62c6\u7bb1\u8fd8\u53ef\u80fd\u5728\u4ee5\u4e0b\u573a\u666f\u4e2d\u5f15\u53d1NPE&#xff1a; <span style=\"color:#956fe7\">\u7b97\u672f\u8fd0\u7b97&#xff1a;<\/span><\/p>\n<p>\u00a0 Integer a &#061; null;<br \/>\n\u00a0 Integer b &#061; 10;<br \/>\n\u00a0 int result &#061; a &#043; b; \/\/ \u629b\u51faNullPointerException <\/p>\n<p>\u5728\u8fd9\u91cc&#xff0c;&#096;a&#096;\u548c&#096;b&#096;\u90fd\u4f1a\u88ab\u81ea\u52a8\u62c6\u7bb1&#xff0c;\u800c&#096;a&#096;\u4e3a&#096;null&#096;&#xff0c;\u5bfc\u81f4NPE\u3002<\/p>\n<p><span style=\"color:#956fe7\">\u6bd4\u8f83\u8fd0\u7b97&#xff1a;<\/span><\/p>\n<p>\u00a0 Integer x &#061; null;<br \/>\n\u00a0 Integer y &#061; 10;<br \/>\n\u00a0 boolean isEqual &#061; x.equals(y); \/\/ \u629b\u51faNullPointerException <\/p>\n<p>\u00a0 \u5728\u8fd9\u91cc&#xff0c;&#096;x&#096;\u4e3a&#096;null&#096;&#xff0c;\u8c03\u7528&#096;x.equals(y)&#096;\u4f1a\u629b\u51faNPE\u3002<\/p>\n<h2 id=\"%E4%B8%83%E3%80%81%E6%80%BB%E7%BB%93%E5%BD%92%E7%BA%B3\" style=\"background-color:transparent\">\u4e03\u3001\u603b\u7ed3\u5f52\u7eb3<\/h2>\n<ul>\n<li>\n<p>\u81ea\u52a8\u88c5\u7bb1\u548c\u81ea\u52a8\u62c6\u7bb1\u867d\u7136\u65b9\u4fbf&#xff0c;\u4f46\u5728\u4f7f\u7528\u5305\u88c5\u7c7b\u65f6\u9700\u8981\u7279\u522b\u6ce8\u610f&#096;null&#096;\u503c\u3002<\/p>\n<\/li>\n<li>\n<p>\u81ea\u52a8\u62c6\u7bb1\u65f6&#xff0c;\u5982\u679c\u5305\u88c5\u7c7b\u5bf9\u8c61\u4e3a&#096;null&#096;&#xff0c;\u5c31\u4f1a\u629b\u51fa&#096;NullPointerException&#096;\u3002<\/p>\n<\/li>\n<li>\n<p>\u4e3a\u4e86\u907f\u514d\u8fd9\u79cd\u98ce\u9669&#xff0c;\u5efa\u8bae\u5728\u81ea\u52a8\u62c6\u7bb1\u4e4b\u524d\u68c0\u67e5\u5bf9\u8c61\u662f\u5426\u4e3a&#096;null&#096;&#xff0c;\u6216\u8005\u5c3d\u91cf\u4f7f\u7528\u57fa\u672c\u6570\u636e\u7c7b\u578b&#xff08;\u5982&#096;int&#096;&#xff09;\u800c\u4e0d\u662f\u5305\u88c5\u7c7b&#xff08;\u5982&#096;Integer&#096;&#xff09;&#xff0c;\u9664\u975e\u786e\u5b9e\u9700\u8981\u5305\u88c5\u7c7b\u7684\u7279\u6027&#xff08;\u5982&#096;null&#096;\u503c\u6216\u6cdb\u578b&#xff09;\u3002<\/p>\n<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb234\u6b21\uff0c\u70b9\u8d5e3\u6b21\uff0c\u6536\u85cf2\u6b21\u3002\u5728Java\u4e2d\uff0c\u81ea\u52a8\u88c5\u7bb1\u548c\u81ea\u52a8\u62c6\u7bb1\u662fJava\u8bed\u8a00\u4e3a\u4e86\u65b9\u4fbf\u5f00\u53d1\u800c\u5f15\u5165\u7684\u7279\u6027\uff0c\u4f46\u5b83\u4eec\u4e5f\u53ef\u80fd\u5e26\u6765\u4e00\u4e9b\u6f5c\u5728\u7684\u98ce\u9669\u5982\u7a7a\u6307\u9488\u5f02\u5e38\uff08\u7b80\u79f0NPE\uff09\u3002\u672c\u6587\u4ecb\u7ecd\u5173\u4e8e\u8fd9\u4e2a\u98ce\u9669\u7684\u8bf4\u660e\uff0c\u6210\u56e0\u7b49\u5185\u5bb9\u3002<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[99,371,190],"topic":[],"class_list":["post-55835","post","type-post","status-publish","format-standard","hentry","category-server","tag-java","tag-371","tag-190"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Java\u5b66\u4e60\u7b2c\u4e00\u767e\u4e09\u5341\u4e94\u90e8\u5206\u2014\u2014\u81ea\u52a8\u88c5\u7bb1\/\u62c6\u7bb1\u7684NPE\u98ce\u9669 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/55835.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Java\u5b66\u4e60\u7b2c\u4e00\u767e\u4e09\u5341\u4e94\u90e8\u5206\u2014\u2014\u81ea\u52a8\u88c5\u7bb1\/\u62c6\u7bb1\u7684NPE\u98ce\u9669 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb234\u6b21\uff0c\u70b9\u8d5e3\u6b21\uff0c\u6536\u85cf2\u6b21\u3002\u5728Java\u4e2d\uff0c\u81ea\u52a8\u88c5\u7bb1\u548c\u81ea\u52a8\u62c6\u7bb1\u662fJava\u8bed\u8a00\u4e3a\u4e86\u65b9\u4fbf\u5f00\u53d1\u800c\u5f15\u5165\u7684\u7279\u6027\uff0c\u4f46\u5b83\u4eec\u4e5f\u53ef\u80fd\u5e26\u6765\u4e00\u4e9b\u6f5c\u5728\u7684\u98ce\u9669\u5982\u7a7a\u6307\u9488\u5f02\u5e38\uff08\u7b80\u79f0NPE\uff09\u3002\u672c\u6587\u4ecb\u7ecd\u5173\u4e8e\u8fd9\u4e2a\u98ce\u9669\u7684\u8bf4\u660e\uff0c\u6210\u56e0\u7b49\u5185\u5bb9\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/55835.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-08-14T00:54:42+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/55835.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/55835.html\",\"name\":\"Java\u5b66\u4e60\u7b2c\u4e00\u767e\u4e09\u5341\u4e94\u90e8\u5206\u2014\u2014\u81ea\u52a8\u88c5\u7bb1\/\u62c6\u7bb1\u7684NPE\u98ce\u9669 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-08-14T00:54:42+00:00\",\"dateModified\":\"2025-08-14T00:54:42+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/55835.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/55835.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/55835.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\u5b66\u4e60\u7b2c\u4e00\u767e\u4e09\u5341\u4e94\u90e8\u5206\u2014\u2014\u81ea\u52a8\u88c5\u7bb1\/\u62c6\u7bb1\u7684NPE\u98ce\u9669\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Java\u5b66\u4e60\u7b2c\u4e00\u767e\u4e09\u5341\u4e94\u90e8\u5206\u2014\u2014\u81ea\u52a8\u88c5\u7bb1\/\u62c6\u7bb1\u7684NPE\u98ce\u9669 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/55835.html","og_locale":"zh_CN","og_type":"article","og_title":"Java\u5b66\u4e60\u7b2c\u4e00\u767e\u4e09\u5341\u4e94\u90e8\u5206\u2014\u2014\u81ea\u52a8\u88c5\u7bb1\/\u62c6\u7bb1\u7684NPE\u98ce\u9669 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb234\u6b21\uff0c\u70b9\u8d5e3\u6b21\uff0c\u6536\u85cf2\u6b21\u3002\u5728Java\u4e2d\uff0c\u81ea\u52a8\u88c5\u7bb1\u548c\u81ea\u52a8\u62c6\u7bb1\u662fJava\u8bed\u8a00\u4e3a\u4e86\u65b9\u4fbf\u5f00\u53d1\u800c\u5f15\u5165\u7684\u7279\u6027\uff0c\u4f46\u5b83\u4eec\u4e5f\u53ef\u80fd\u5e26\u6765\u4e00\u4e9b\u6f5c\u5728\u7684\u98ce\u9669\u5982\u7a7a\u6307\u9488\u5f02\u5e38\uff08\u7b80\u79f0NPE\uff09\u3002\u672c\u6587\u4ecb\u7ecd\u5173\u4e8e\u8fd9\u4e2a\u98ce\u9669\u7684\u8bf4\u660e\uff0c\u6210\u56e0\u7b49\u5185\u5bb9\u3002","og_url":"https:\/\/www.wsisp.com\/helps\/55835.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-08-14T00:54:42+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/55835.html","url":"https:\/\/www.wsisp.com\/helps\/55835.html","name":"Java\u5b66\u4e60\u7b2c\u4e00\u767e\u4e09\u5341\u4e94\u90e8\u5206\u2014\u2014\u81ea\u52a8\u88c5\u7bb1\/\u62c6\u7bb1\u7684NPE\u98ce\u9669 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-08-14T00:54:42+00:00","dateModified":"2025-08-14T00:54:42+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/55835.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/55835.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/55835.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"Java\u5b66\u4e60\u7b2c\u4e00\u767e\u4e09\u5341\u4e94\u90e8\u5206\u2014\u2014\u81ea\u52a8\u88c5\u7bb1\/\u62c6\u7bb1\u7684NPE\u98ce\u9669"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/55835","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=55835"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/55835\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=55835"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=55835"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=55835"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=55835"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}