{"id":68258,"date":"2026-01-29T23:49:16","date_gmt":"2026-01-29T15:49:16","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/68258.html"},"modified":"2026-01-29T23:49:16","modified_gmt":"2026-01-29T15:49:16","slug":"java%e5%bc%82%e5%b8%b8%e8%af%a6%e8%a7%a3%ef%bc%9a%e4%b8%ba0%e5%9f%ba%e7%a1%80%e5%b0%8f%e7%99%bd%e4%b8%93%e9%97%a8%e6%89%93%e9%80%a0%ef%bc%8c%e5%b8%ae%e5%8a%a9%e4%bd%a0%e5%ad%a6%e4%bc%9a%e5%bc%82","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/68258.html","title":{"rendered":"java\u5f02\u5e38\u8be6\u89e3\uff1a\u4e3a0\u57fa\u7840\u5c0f\u767d\u4e13\u95e8\u6253\u9020\uff0c\u5e2e\u52a9\u4f60\u5b66\u4f1a\u5f02\u5e38\u5904\u7406\uff01"},"content":{"rendered":"<p id=\"main-toc\">\u76ee\u5f55<\/p>\n<p id=\"%E4%B8%80%E3%80%81%E5%85%88%E6%90%9E%E6%87%82%EF%BC%9A%E5%BC%82%E5%B8%B8%E5%88%B0%E5%BA%95%E6%98%AF%E4%BB%80%E4%B9%88%EF%BC%9F%EF%BC%88%E5%A4%A7%E7%99%BD%E8%AF%9D%E8%A7%A3%E9%87%8A%EF%BC%89-toc\" style=\"margin-left:40px\">\u4e00\u3001\u5148\u641e\u61c2&#xff1a;\u5f02\u5e38\u5230\u5e95\u662f\u4ec0\u4e48&#xff1f;&#xff08;\u5927\u767d\u8bdd\u89e3\u91ca&#xff09;<\/p>\n<p id=\"%E4%BA%8C%E3%80%81Java%20%E5%BC%82%E5%B8%B8%E7%9A%84%E4%B8%A4%E5%A4%A7%E5%88%86%E7%B1%BB%EF%BC%88%E6%A0%B8%E5%BF%83%EF%BC%81%E8%AE%B0%E6%B8%85%E8%BF%99%E4%B8%A4%E7%B1%BB%E5%B0%B1%E5%A4%9F%E4%BA%86%EF%BC%89-toc\" style=\"margin-left:40px\">\u4e8c\u3001Java \u5f02\u5e38\u7684\u4e24\u5927\u5206\u7c7b&#xff08;\u6838\u5fc3&#xff01;\u8bb0\u6e05\u8fd9\u4e24\u7c7b\u5c31\u591f\u4e86&#xff09;<\/p>\n<p id=\"1.%20%E8%BF%90%E8%A1%8C%E6%97%B6%E5%BC%82%E5%B8%B8%EF%BC%88%E9%9D%9E%E6%A3%80%E6%9F%A5%E5%9E%8B%E5%BC%82%E5%B8%B8%EF%BC%89%E2%80%94%E2%80%94%20%E6%9C%80%E5%B8%B8%E8%A7%81%EF%BC%8C%E5%8F%AF%E5%A4%84%E7%90%86%E5%8F%AF%E4%B8%8D%E5%A4%84%E7%90%86-toc\" style=\"margin-left:80px\">1. \u8fd0\u884c\u65f6\u5f02\u5e38&#xff08;\u975e\u68c0\u67e5\u578b\u5f02\u5e38&#xff09;\u2014\u2014 \u6700\u5e38\u89c1&#xff0c;\u53ef\u5904\u7406\u53ef\u4e0d\u5904\u7406<\/p>\n<p id=\"%E6%A0%B8%E5%BF%83%E7%89%B9%E7%82%B9-toc\" style=\"margin-left:120px\">\u6838\u5fc3\u7279\u70b9<\/p>\n<p id=\"%E5%B8%B8%E8%A7%81%E4%BE%8B%E5%AD%90%EF%BC%88%E8%AE%B0%E8%BF%99%205%20%E4%B8%AA%EF%BC%8C%E8%A6%86%E7%9B%96%2080%25%20%E5%BC%80%E5%8F%91%E5%9C%BA%E6%99%AF%EF%BC%89-toc\" style=\"margin-left:120px\">\u5e38\u89c1\u4f8b\u5b50&#xff08;\u8bb0\u8fd9 5 \u4e2a&#xff0c;\u8986\u76d6 80% \u5f00\u53d1\u573a\u666f&#xff09;<\/p>\n<p id=\"2.%20%E7%BC%96%E8%AF%91%E6%97%B6%E5%BC%82%E5%B8%B8%EF%BC%88%E6%A3%80%E6%9F%A5%E5%9E%8B%E5%BC%82%E5%B8%B8%EF%BC%89%E2%80%94%E2%80%94%20%E7%BC%96%E8%AF%91%E5%99%A8%E5%BC%BA%E5%88%B6%E8%A6%81%E6%B1%82%E5%A4%84%E7%90%86%EF%BC%8C%E4%B8%8D%E5%A4%84%E7%90%86%E7%BC%96%E8%AF%91%E6%8A%A5%E9%94%99-toc\" style=\"margin-left:80px\">2. \u7f16\u8bd1\u65f6\u5f02\u5e38&#xff08;\u68c0\u67e5\u578b\u5f02\u5e38&#xff09;\u2014\u2014 \u7f16\u8bd1\u5668\u5f3a\u5236\u8981\u6c42\u5904\u7406&#xff0c;\u4e0d\u5904\u7406\u7f16\u8bd1\u62a5\u9519<\/p>\n<p id=\"%E6%A0%B8%E5%BF%83%E7%89%B9%E7%82%B9-toc\" style=\"margin-left:120px\">\u6838\u5fc3\u7279\u70b9<\/p>\n<p id=\"%E5%B8%B8%E8%A7%81%E4%BE%8B%E5%AD%90%EF%BC%88%E8%AE%B0%E8%BF%99%203%20%E4%B8%AA%EF%BC%8C%E8%A6%86%E7%9B%96%E5%BC%80%E5%8F%91%E5%B8%B8%E7%94%A8%E5%9C%BA%E6%99%AF%EF%BC%89-toc\" style=\"margin-left:120px\">\u5e38\u89c1\u4f8b\u5b50&#xff08;\u8bb0\u8fd9 3 \u4e2a&#xff0c;\u8986\u76d6\u5f00\u53d1\u5e38\u7528\u573a\u666f&#xff09;<\/p>\n<p id=\"%E4%B8%A4%E7%B1%BB%E5%BC%82%E5%B8%B8%E6%A0%B8%E5%BF%83%E5%AF%B9%E6%AF%94%EF%BC%88%E4%B8%80%E5%BC%A0%E8%A1%A8%E8%AE%B0%E7%89%A2%EF%BC%89-toc\" style=\"margin-left:80px\">\u4e24\u7c7b\u5f02\u5e38\u6838\u5fc3\u5bf9\u6bd4&#xff08;\u4e00\u5f20\u8868\u8bb0\u7262&#xff09;<\/p>\n<p id=\"%E4%B8%89%E3%80%81%E5%BC%82%E5%B8%B8%E5%A4%84%E7%90%86%E7%9A%84%203%20%E4%B8%AA%E6%A0%B8%E5%BF%83%E5%85%B3%E9%94%AE%E5%AD%97%20%E2%80%94%E2%80%94try%E3%80%81catch%E3%80%81finally%EF%BC%88%E9%9B%B6%E5%9F%BA%E7%A1%80%E5%BF%85%E5%AD%A6%EF%BC%89-toc\" style=\"margin-left:40px\">\u4e09\u3001\u5f02\u5e38\u5904\u7406\u7684 3 \u4e2a\u6838\u5fc3\u5173\u952e\u5b57 \u2014\u2014try\u3001catch\u3001finally&#xff08;\u96f6\u57fa\u7840\u5fc5\u5b66&#xff09;<\/p>\n<p id=\"%E6%A0%B8%E5%BF%83%E6%80%9D%E6%83%B3-toc\" style=\"margin-left:80px\">\u6838\u5fc3\u601d\u60f3<\/p>\n<p id=\"%E5%9F%BA%E7%A1%80%E8%AF%AD%E6%B3%95%E6%A8%A1%E6%9D%BF%EF%BC%88%E6%AD%BB%E8%AE%B0%E7%A1%AC%E8%83%8C%EF%BC%8C%E7%9B%B4%E6%8E%A5%E5%A5%97%E7%94%A8%EF%BC%89-toc\" style=\"margin-left:80px\">\u57fa\u7840\u8bed\u6cd5\u6a21\u677f&#xff08;\u6b7b\u8bb0\u786c\u80cc&#xff0c;\u76f4\u63a5\u5957\u7528&#xff09;<\/p>\n<p id=\"%E5%85%B3%E9%94%AE%E8%A7%84%E5%88%99%EF%BC%88%E9%9B%B6%E5%9F%BA%E7%A1%80%E5%BF%85%E7%9C%8B%EF%BC%8C%E9%81%BF%E5%85%8D%E8%B8%A9%E5%9D%91%EF%BC%89-toc\" style=\"margin-left:80px\">\u5173\u952e\u89c4\u5219&#xff08;\u96f6\u57fa\u7840\u5fc5\u770b&#xff0c;\u907f\u514d\u8e29\u5751&#xff09;<\/p>\n<p id=\"%E5%85%A5%E9%97%A8%E7%A4%BA%E4%BE%8B%201%EF%BC%9A%E5%A4%84%E7%90%86%E8%BF%90%E8%A1%8C%E6%97%B6%E5%BC%82%E5%B8%B8%EF%BC%88%E9%99%A4%E4%BB%A5%200%EF%BC%8CArithmeticException%EF%BC%89-toc\" style=\"margin-left:80px\">\u5165\u95e8\u793a\u4f8b 1&#xff1a;\u5904\u7406\u8fd0\u884c\u65f6\u5f02\u5e38&#xff08;\u9664\u4ee5 0&#xff0c;ArithmeticException&#xff09;<\/p>\n<p id=\"%E5%85%A5%E9%97%A8%E7%A4%BA%E4%BE%8B%202%EF%BC%9A%E5%A4%9A%20catch%20%E5%9D%97%EF%BC%88%E5%A4%84%E7%90%86%E5%A4%9A%E7%A7%8D%E4%B8%8D%E5%90%8C%E5%BC%82%E5%B8%B8%EF%BC%89-toc\" style=\"margin-left:80px\">\u5165\u95e8\u793a\u4f8b 2&#xff1a;\u591a catch \u5757&#xff08;\u5904\u7406\u591a\u79cd\u4e0d\u540c\u5f02\u5e38&#xff09;<\/p>\n<p id=\"%E5%85%A5%E9%97%A8%E7%A4%BA%E4%BE%8B%203%EF%BC%9Afinally%20%E7%9A%84%E6%A0%B8%E5%BF%83%E4%BD%9C%E7%94%A8%20%E2%80%94%E2%80%94%20%E9%87%8A%E6%94%BE%E8%B5%84%E6%BA%90%EF%BC%88%E5%BF%85%E7%94%A8%E5%9C%BA%E6%99%AF%EF%BC%89-toc\" style=\"margin-left:80px\">\u5165\u95e8\u793a\u4f8b 3&#xff1a;finally \u7684\u6838\u5fc3\u4f5c\u7528 \u2014\u2014 \u91ca\u653e\u8d44\u6e90&#xff08;\u5fc5\u7528\u573a\u666f&#xff09;<\/p>\n<p id=\"%E5%9B%9B%E3%80%81%E5%A4%84%E7%90%86%E7%BC%96%E8%AF%91%E6%97%B6%E5%BC%82%E5%B8%B8%E7%9A%84%202%20%E7%A7%8D%E6%96%B9%E5%BC%8F%EF%BC%88%E7%BC%96%E8%AF%91%E5%99%A8%E5%BC%BA%E5%88%B6%E8%A6%81%E6%B1%82%EF%BC%8C%E4%BA%8C%E9%80%89%E4%B8%80%EF%BC%89-toc\" style=\"margin-left:40px\">\u56db\u3001\u5904\u7406\u7f16\u8bd1\u65f6\u5f02\u5e38\u7684 2 \u79cd\u65b9\u5f0f&#xff08;\u7f16\u8bd1\u5668\u5f3a\u5236\u8981\u6c42&#xff0c;\u4e8c\u9009\u4e00&#xff09;<\/p>\n<p id=\"%E6%96%B9%E5%BC%8F%201%EF%BC%9Atry-catch-finally%20%E6%8D%95%E8%8E%B7%E5%A4%84%E7%90%86%EF%BC%88%E6%8E%A8%E8%8D%90%EF%BC%8C%E4%B8%BB%E5%8A%A8%E5%A4%84%E7%90%86%E5%BC%82%E5%B8%B8%EF%BC%89-toc\" style=\"margin-left:80px\">\u65b9\u5f0f 1&#xff1a;try-catch-finally \u6355\u83b7\u5904\u7406&#xff08;\u63a8\u8350&#xff0c;\u4e3b\u52a8\u5904\u7406\u5f02\u5e38&#xff09;<\/p>\n<p id=\"%E7%A4%BA%E4%BE%8B%EF%BC%9A%E5%A4%84%E7%90%86%E6%8E%A7%E5%88%B6%E5%8F%B0%E8%BE%93%E5%85%A5%E7%9A%84%20IOException%EF%BC%88%E7%BC%96%E8%AF%91%E6%97%B6%E5%BC%82%E5%B8%B8%EF%BC%89-toc\" style=\"margin-left:120px\">\u793a\u4f8b&#xff1a;\u5904\u7406\u63a7\u5236\u53f0\u8f93\u5165\u7684 IOException&#xff08;\u7f16\u8bd1\u65f6\u5f02\u5e38&#xff09;<\/p>\n<p id=\"%E6%96%B9%E5%BC%8F%202%EF%BC%9Athrows%20%E5%A3%B0%E6%98%8E%E5%BC%82%E5%B8%B8%EF%BC%88%E7%94%A9%E9%94%85%EF%BC%8C%E6%8A%8A%E5%BC%82%E5%B8%B8%E4%BA%A4%E7%BB%99%E4%B8%8A%E5%B1%82%E5%A4%84%E7%90%86%EF%BC%89-toc\" style=\"margin-left:80px\">\u65b9\u5f0f 2&#xff1a;throws \u58f0\u660e\u5f02\u5e38&#xff08;\u7529\u9505&#xff0c;\u628a\u5f02\u5e38\u4ea4\u7ed9\u4e0a\u5c42\u5904\u7406&#xff09;<\/p>\n<p id=\"%E7%A4%BA%E4%BE%8B%EF%BC%9Amain%20%E6%96%B9%E6%B3%95%20throws%20%E5%A3%B0%E6%98%8E%20IOException%EF%BC%8C%E7%94%A9%E9%94%85%E7%BB%99%20JVM-toc\" style=\"margin-left:120px\">\u793a\u4f8b&#xff1a;main \u65b9\u6cd5 throws \u58f0\u660e IOException&#xff0c;\u7529\u9505\u7ed9 JVM<\/p>\n<p id=\"%E4%B8%A4%E7%A7%8D%E6%96%B9%E5%BC%8F%E5%AF%B9%E6%AF%94%EF%BC%88%E9%9B%B6%E5%9F%BA%E7%A1%80%E6%80%8E%E4%B9%88%E9%80%89%EF%BC%9F%EF%BC%89-toc\" style=\"margin-left:80px\">\u4e24\u79cd\u65b9\u5f0f\u5bf9\u6bd4&#xff08;\u96f6\u57fa\u7840\u600e\u4e48\u9009&#xff1f;&#xff09;<\/p>\n<p id=\"%E4%BA%94%E3%80%812%20%E4%B8%AA%E8%BF%9B%E9%98%B6%E5%85%B3%E9%94%AE%E5%AD%97%EF%BC%9Athrow%EF%BC%88%E4%B8%BB%E5%8A%A8%E6%8A%9B%E5%BC%82%E5%B8%B8%EF%BC%89%E3%80%81throws%EF%BC%88%E5%A3%B0%E6%98%8E%E5%BC%82%E5%B8%B8%EF%BC%89-toc\" style=\"margin-left:40px\">\u4e94\u30012 \u4e2a\u8fdb\u9636\u5173\u952e\u5b57&#xff1a;throw&#xff08;\u4e3b\u52a8\u629b\u5f02\u5e38&#xff09;\u3001throws&#xff08;\u58f0\u660e\u5f02\u5e38&#xff09;<\/p>\n<p id=\"1.%20throw%20%E2%80%94%E2%80%94%20%E6%89%8B%E5%8A%A8%20%2F%20%E4%B8%BB%E5%8A%A8%E6%8A%9B%E5%87%BA%E4%B8%80%E4%B8%AA%E5%BC%82%E5%B8%B8%EF%BC%88%E6%96%B9%E6%B3%95%E5%86%85%E9%83%A8%E7%94%A8%EF%BC%89-toc\" style=\"margin-left:80px\">1. throw \u2014\u2014 \u624b\u52a8 \/ \u4e3b\u52a8\u629b\u51fa\u4e00\u4e2a\u5f02\u5e38&#xff08;\u65b9\u6cd5\u5185\u90e8\u7528&#xff09;<\/p>\n<p id=\"%E4%BD%9C%E7%94%A8-toc\" style=\"margin-left:120px\">\u4f5c\u7528<\/p>\n<p id=\"%E8%AF%AD%E6%B3%95-toc\" style=\"margin-left:120px\">\u8bed\u6cd5<\/p>\n<p id=\"%E7%A4%BA%E4%BE%8B%EF%BC%9A%E4%B8%BB%E5%8A%A8%E6%8A%9B%E5%87%BA%E9%9D%9E%E6%B3%95%E5%8F%82%E6%95%B0%E5%BC%82%E5%B8%B8%EF%BC%88IllegalArgumentException%EF%BC%8C%E8%BF%90%E8%A1%8C%E6%97%B6%E5%BC%82%E5%B8%B8%EF%BC%89-toc\" style=\"margin-left:120px\">\u793a\u4f8b&#xff1a;\u4e3b\u52a8\u629b\u51fa\u975e\u6cd5\u53c2\u6570\u5f02\u5e38&#xff08;IllegalArgumentException&#xff0c;\u8fd0\u884c\u65f6\u5f02\u5e38&#xff09;<\/p>\n<p id=\"2.%20throws%20%E2%80%94%E2%80%94%20%E5%A3%B0%E6%98%8E%E6%96%B9%E6%B3%95%E5%8F%AF%E8%83%BD%E6%8A%9B%E5%87%BA%E7%9A%84%E5%BC%82%E5%B8%B8%EF%BC%88%E6%96%B9%E6%B3%95%E5%90%8D%E5%90%8E%E9%9D%A2%E7%94%A8%EF%BC%89-toc\" style=\"margin-left:80px\">2. throws \u2014\u2014 \u58f0\u660e\u65b9\u6cd5\u53ef\u80fd\u629b\u51fa\u7684\u5f02\u5e38&#xff08;\u65b9\u6cd5\u540d\u540e\u9762\u7528&#xff09;<\/p>\n<p id=\"%E4%BD%9C%E7%94%A8-toc\" style=\"margin-left:120px\">\u4f5c\u7528<\/p>\n<p id=\"%E7%A4%BA%E4%BE%8B%EF%BC%9A%E6%96%B9%E6%B3%95%E5%86%85%20throw%20%E5%BC%82%E5%B8%B8%EF%BC%8C%E6%96%B9%E6%B3%95%E5%90%8D%E5%90%8E%20throws%20%E5%A3%B0%E6%98%8E-toc\" style=\"margin-left:120px\">\u793a\u4f8b&#xff1a;\u65b9\u6cd5\u5185 throw \u5f02\u5e38&#xff0c;\u65b9\u6cd5\u540d\u540e throws \u58f0\u660e<\/p>\n<p id=\"throw%20%E5%92%8C%20throws%20%E6%A0%B8%E5%BF%83%E5%8C%BA%E5%88%AB%EF%BC%88%E4%B8%80%E5%BC%A0%E8%A1%A8%E5%88%86%E6%B8%85%EF%BC%8C%E4%B8%8D%E6%B7%B7%E6%B7%86%EF%BC%89-toc\" style=\"margin-left:80px\">throw \u548c throws \u6838\u5fc3\u533a\u522b&#xff08;\u4e00\u5f20\u8868\u5206\u6e05&#xff0c;\u4e0d\u6df7\u6dc6&#xff09;<\/p>\n<p id=\"%E5%85%AD%E3%80%81%E9%9B%B6%E5%9F%BA%E7%A1%80%E5%BC%82%E5%B8%B8%E5%A4%84%E7%90%86%E7%9A%84%205%20%E4%B8%AA%E9%BB%84%E9%87%91%E5%8E%9F%E5%88%99%EF%BC%88%E9%81%BF%E5%9D%91%E5%BF%85%E5%A4%87%EF%BC%8C%E7%9B%B4%E6%8E%A5%E5%A5%97%E7%94%A8%EF%BC%89-toc\" style=\"margin-left:40px\">\u516d\u3001\u96f6\u57fa\u7840\u5f02\u5e38\u5904\u7406\u7684 5 \u4e2a\u9ec4\u91d1\u539f\u5219&#xff08;\u907f\u5751\u5fc5\u5907&#xff0c;\u76f4\u63a5\u5957\u7528&#xff09;<\/p>\n<p id=\"%E5%8E%9F%E5%88%99%201%EF%BC%9A%E5%B1%80%E9%83%A8%E5%8F%98%E9%87%8F%E5%BF%85%E9%A1%BB%E5%88%9D%E5%A7%8B%E5%8C%96%EF%BC%8C%E9%81%BF%E5%85%8D%20%E2%80%9C%E6%9C%AA%E5%88%9D%E5%A7%8B%E5%8C%96%E2%80%9D%20%E5%AF%BC%E8%87%B4%E7%9A%84%E5%BC%82%E5%B8%B8-toc\" style=\"margin-left:80px\">\u539f\u5219 1&#xff1a;\u5c40\u90e8\u53d8\u91cf\u5fc5\u987b\u521d\u59cb\u5316&#xff0c;\u907f\u514d \u201c\u672a\u521d\u59cb\u5316\u201d \u5bfc\u81f4\u7684\u5f02\u5e38<\/p>\n<p id=\"%E5%8E%9F%E5%88%99%202%EF%BC%9A%E8%B0%83%E7%94%A8%E5%AF%B9%E8%B1%A1%E7%9A%84%E6%96%B9%E6%B3%95%20%2F%20%E5%B1%9E%E6%80%A7%E5%89%8D%EF%BC%8C%E5%85%88%E5%88%A4%E7%A9%BA%EF%BC%88%E9%81%BF%E5%85%8D%E7%A9%BA%E6%8C%87%E9%92%88%EF%BC%89-toc\" style=\"margin-left:80px\">\u539f\u5219 2&#xff1a;\u8c03\u7528\u5bf9\u8c61\u7684\u65b9\u6cd5 \/ \u5c5e\u6027\u524d&#xff0c;\u5148\u5224\u7a7a&#xff08;\u907f\u514d\u7a7a\u6307\u9488&#xff09;<\/p>\n<p id=\"%E5%8E%9F%E5%88%99%203%EF%BC%9A%E8%B5%84%E6%BA%90%E4%BD%BF%E7%94%A8%E5%90%8E%E5%BF%85%E9%A1%BB%E5%85%B3%E9%97%AD%EF%BC%8C%E4%B8%94%E5%85%B3%E9%97%AD%E5%89%8D%E8%A6%81%E5%88%A4%E7%A9%BA-toc\" style=\"margin-left:80px\">\u539f\u5219 3&#xff1a;\u8d44\u6e90\u4f7f\u7528\u540e\u5fc5\u987b\u5173\u95ed&#xff0c;\u4e14\u5173\u95ed\u524d\u8981\u5224\u7a7a<\/p>\n<p id=\"%E5%8E%9F%E5%88%99%204%EF%BC%9Acatch%20%E5%9D%97%E8%A6%81%E9%92%88%E5%AF%B9%E6%80%A7%E5%A4%84%E7%90%86%EF%BC%8C%E4%B8%8D%E8%A6%81%E5%8F%AA%E5%86%99%E4%B8%80%E4%B8%AA%20Exception-toc\" style=\"margin-left:80px\">\u539f\u5219 4&#xff1a;catch \u5757\u8981\u9488\u5bf9\u6027\u5904\u7406&#xff0c;\u4e0d\u8981\u53ea\u5199\u4e00\u4e2a Exception<\/p>\n<p id=\"%E5%8E%9F%E5%88%99%205%EF%BC%9A%E8%BF%90%E8%A1%8C%E6%97%B6%E5%BC%82%E5%B8%B8%E5%B0%BD%E9%87%8F%E5%A4%84%E7%90%86%EF%BC%8C%E7%BC%96%E8%AF%91%E6%97%B6%E5%BC%82%E5%B8%B8%E5%BF%85%E9%A1%BB%E5%A4%84%E7%90%86-toc\" style=\"margin-left:80px\">\u539f\u5219 5&#xff1a;\u8fd0\u884c\u65f6\u5f02\u5e38\u5c3d\u91cf\u5904\u7406&#xff0c;\u7f16\u8bd1\u65f6\u5f02\u5e38\u5fc5\u987b\u5904\u7406<\/p>\n<p id=\"%E4%B8%83%E3%80%81%E9%9B%B6%E5%9F%BA%E7%A1%80%E5%BF%AB%E9%80%9F%E4%B8%8A%E6%89%8B%E6%80%BB%E7%BB%93%EF%BC%88%E6%A0%B8%E5%BF%83%E7%9F%A5%E8%AF%86%E7%82%B9%E6%B5%93%E7%BC%A9%EF%BC%8C%E4%B8%80%E5%88%86%E9%92%9F%E5%9B%9E%E9%A1%BE%EF%BC%89-toc\" style=\"margin-left:40px\">\u4e03\u3001\u96f6\u57fa\u7840\u5feb\u901f\u4e0a\u624b\u603b\u7ed3&#xff08;\u6838\u5fc3\u77e5\u8bc6\u70b9\u6d53\u7f29&#xff0c;\u4e00\u5206\u949f\u56de\u987e&#xff09;<\/p>\n<hr id=\"hr-toc\" \/>\n<p>\u672c\u6587\u4e13\u4e3a Java \u96f6\u57fa\u7840\u5c0f\u767d\u6253\u9020&#xff0c;\u7528\u901a\u4fd7\u7684\u8bed\u8a00\u3001\u76f4\u767d\u7684\u4f8b\u5b50\u8bb2\u6e05\u5f02\u5e38\u662f\u4ec0\u4e48\u3001\u5f02\u5e38\u6709\u54ea\u4e9b\u3001\u600e\u4e48\u5904\u7406\u5f02\u5e38\u3001\u5982\u4f55\u4e3b\u52a8\u629b\u5f02\u5e38&#xff0c;\u5168\u7a0b\u907f\u5f00\u590d\u6742\u672f\u8bed&#xff0c;\u5b66\u5b8c\u5c31\u80fd\u4e0a\u624b\u5199\u5f02\u5e38\u5904\u7406\u4ee3\u7801&#xff0c;\u8f7b\u677e\u641e\u5b9a Java \u5f02\u5e38\u6838\u5fc3\u77e5\u8bc6\u70b9&#xff01;<\/p>\n<h3 id=\"%E4%B8%80%E3%80%81%E5%85%88%E6%90%9E%E6%87%82%EF%BC%9A%E5%BC%82%E5%B8%B8%E5%88%B0%E5%BA%95%E6%98%AF%E4%BB%80%E4%B9%88%EF%BC%9F%EF%BC%88%E5%A4%A7%E7%99%BD%E8%AF%9D%E8%A7%A3%E9%87%8A%EF%BC%89\">\u4e00\u3001\u5148\u641e\u61c2&#xff1a;\u5f02\u5e38\u5230\u5e95\u662f\u4ec0\u4e48&#xff1f;&#xff08;\u5927\u767d\u8bdd\u89e3\u91ca&#xff09;<\/h3>\n<p>\u4f60\u5199\u7684 Java \u4ee3\u7801&#xff0c;\u7f16\u8bd1\u6ca1\u62a5\u9519&#xff0c;\u4f46\u8fd0\u884c\u65f6\u7a81\u7136\u5d29\u4e86 \/ \u51fa\u95ee\u9898&#xff0c;\u8fd9\u79cd\u8fd0\u884c\u65f6\u7684\u9519\u8bef \/ \u610f\u5916\u60c5\u51b5&#xff0c;\u5c31\u662f Java \u4e2d\u7684\u5f02\u5e38\u3002<\/p>\n<ul>\n<li>\u6bd4\u5982&#xff1a;\u7528\u4e00\u4e2a\u6570\u9664\u4ee5 0&#xff08;int a &#061; 10 \/ 0;&#xff09;\u3001\u8bbf\u95ee\u6570\u7ec4\u65f6\u4e0b\u6807\u8d8a\u754c&#xff08;int[] arr &#061; {1,2}; arr[5] &#061; 3;&#xff09;\u3001\u8bfb\u53d6\u6587\u4ef6\u65f6\u6587\u4ef6\u4e0d\u5b58\u5728&#xff0c;\u8fd9\u4e9b\u90fd\u4f1a\u89e6\u53d1\u5f02\u5e38\u3002<\/li>\n<li>\u6ca1\u6709\u5f02\u5e38\u5904\u7406\u65f6&#xff0c;\u7a0b\u5e8f\u4f1a\u76f4\u63a5\u7ec8\u6b62\u8fd0\u884c&#xff0c;\u5e76\u5728\u63a7\u5236\u53f0\u6253\u5370\u4e00\u5806\u7ea2\u8272\u7684\u9519\u8bef\u4fe1\u606f&#xff0c;\u4f53\u9a8c\u6781\u5dee&#xff1b;\u6709\u4e86\u5f02\u5e38\u5904\u7406&#xff0c;\u6211\u4eec\u53ef\u4ee5\u6355\u83b7\u9519\u8bef\u3001\u4f18\u96c5\u5904\u7406&#xff0c;\u8ba9\u7a0b\u5e8f\u7ee7\u7eed\u8fd0\u884c&#xff0c;\u8fd8\u80fd\u7ed9\u7528\u6237\u53cb\u597d\u63d0\u793a\u3002<\/li>\n<\/ul>\n<p>\u7b80\u5355\u7c7b\u6bd4&#xff1a;\u4f60\u51fa\u95e8\u901b\u8857&#xff08;\u7a0b\u5e8f\u8fd0\u884c&#xff09;&#xff0c;\u7a81\u7136\u4e0b\u96e8\u4e86&#xff08;\u5f02\u5e38&#xff09;\u2014\u2014 \u6ca1\u51c6\u5907\u7684\u8bdd\u4f1a\u88ab\u6dcb\u6210\u843d\u6c64\u9e21&#xff08;\u7a0b\u5e8f\u7ec8\u6b62&#xff09;&#xff1b;\u5e26\u4e86\u4f1e&#xff08;\u5f02\u5e38\u5904\u7406&#xff09;&#xff0c;\u5c31\u80fd\u6b63\u5e38\u7ee7\u7eed\u901b\u8857&#xff08;\u7a0b\u5e8f\u8fd0\u884c&#xff09;\u3002<\/p>\n<h3 id=\"%E4%BA%8C%E3%80%81Java%20%E5%BC%82%E5%B8%B8%E7%9A%84%E4%B8%A4%E5%A4%A7%E5%88%86%E7%B1%BB%EF%BC%88%E6%A0%B8%E5%BF%83%EF%BC%81%E8%AE%B0%E6%B8%85%E8%BF%99%E4%B8%A4%E7%B1%BB%E5%B0%B1%E5%A4%9F%E4%BA%86%EF%BC%89\">\u4e8c\u3001Java \u5f02\u5e38\u7684\u4e24\u5927\u5206\u7c7b&#xff08;\u6838\u5fc3&#xff01;\u8bb0\u6e05\u8fd9\u4e24\u7c7b\u5c31\u591f\u4e86&#xff09;<\/h3>\n<p>Java \u628a\u6240\u6709\u5f02\u5e38\u5206\u6210\u4e24\u5927\u9635\u8425&#xff0c;\u5904\u7406\u89c4\u5219\u5b8c\u5168\u4e0d\u540c&#xff0c;\u96f6\u57fa\u7840\u5148\u8bb0\u6e05\u8fd9\u4e24\u7c7b\u7684\u533a\u522b&#xff0c;\u4e0d\u7528\u8bb0\u590d\u6742\u7684\u7ee7\u627f\u5173\u7cfb&#xff0c;\u8bb0\u4f4f\u300c\u7279\u70b9 &#043; \u4f8b\u5b50 &#043; \u5904\u7406\u65b9\u5f0f\u300d\u5373\u53ef\u3002<\/p>\n<h4 id=\"1.%20%E8%BF%90%E8%A1%8C%E6%97%B6%E5%BC%82%E5%B8%B8%EF%BC%88%E9%9D%9E%E6%A3%80%E6%9F%A5%E5%9E%8B%E5%BC%82%E5%B8%B8%EF%BC%89%E2%80%94%E2%80%94%20%E6%9C%80%E5%B8%B8%E8%A7%81%EF%BC%8C%E5%8F%AF%E5%A4%84%E7%90%86%E5%8F%AF%E4%B8%8D%E5%A4%84%E7%90%86\">1. \u8fd0\u884c\u65f6\u5f02\u5e38&#xff08;\u975e\u68c0\u67e5\u578b\u5f02\u5e38&#xff09;\u2014\u2014 \u6700\u5e38\u89c1&#xff0c;\u53ef\u5904\u7406\u53ef\u4e0d\u5904\u7406<\/h4>\n<h5 id=\"%E6%A0%B8%E5%BF%83%E7%89%B9%E7%82%B9\">\u6838\u5fc3\u7279\u70b9<\/h5>\n<ul>\n<li>\u7f16\u8bd1\u65f6\u4e0d\u5f3a\u5236\u8981\u6c42\u5904\u7406&#xff0c;\u7f16\u8bd1\u5668\u4e0d\u4f1a\u62a5\u9519&#xff0c;\u5199\u4ee3\u7801\u65f6\u4e0d\u7528\u7ba1\u4e5f\u80fd\u7f16\u8bd1\u901a\u8fc7&#xff1b;<\/li>\n<li>\u9519\u8bef\u901a\u5e38\u662f\u7a0b\u5e8f\u5458\u5199\u4ee3\u7801\u7684\u758f\u5ffd\u5bfc\u81f4&#xff08;\u6bd4\u5982\u7c97\u5fc3\u5199\u4e86\u9664\u4ee5 0\u3001\u4e0b\u6807\u8d8a\u754c&#xff09;&#xff1b;<\/li>\n<li>\u8fd0\u884c\u65f6\u624d\u4f1a\u89e6\u53d1&#xff0c;\u89e6\u53d1\u540e\u82e5\u672a\u5904\u7406&#xff0c;\u7a0b\u5e8f\u76f4\u63a5\u7ec8\u6b62\u3002<\/li>\n<\/ul>\n<h5 id=\"%E5%B8%B8%E8%A7%81%E4%BE%8B%E5%AD%90%EF%BC%88%E8%AE%B0%E8%BF%99%205%20%E4%B8%AA%EF%BC%8C%E8%A6%86%E7%9B%96%2080%25%20%E5%BC%80%E5%8F%91%E5%9C%BA%E6%99%AF%EF%BC%89\">\u5e38\u89c1\u4f8b\u5b50&#xff08;\u8bb0\u8fd9 5 \u4e2a&#xff0c;\u8986\u76d6 80% \u5f00\u53d1\u573a\u666f&#xff09;<\/h5>\n<table>\n<tr>\u5f02\u5e38\u540d\u79f0\u89e6\u53d1\u573a\u666f\u5927\u767d\u8bdd\u89e3\u91ca<\/tr>\n<tbody>\n<tr>\n<td>ArithmeticException<\/td>\n<td>\u6574\u6570\u9664\u4ee5 0&#xff08;10\/0&#xff09;<\/td>\n<td>\u6570\u5b66\u8fd0\u7b97\u9519\u8bef<\/td>\n<\/tr>\n<tr>\n<td>ArrayIndexOutOfBoundsException<\/td>\n<td>\u6570\u7ec4\u4e0b\u6807\u8d85\u51fa\u8303\u56f4&#xff08;arr[5]&#xff0c;\u6570\u7ec4\u53ea\u6709 3 \u4e2a\u5143\u7d20&#xff09;<\/td>\n<td>\u6570\u7ec4\u4e0b\u6807\u8d8a\u754c<\/td>\n<\/tr>\n<tr>\n<td>NullPointerException<\/td>\n<td>\u8c03\u7528 null \u5bf9\u8c61\u7684\u65b9\u6cd5 \/ \u5c5e\u6027&#xff08;String s &#061; null; s.length();&#xff09;<\/td>\n<td>\u7a7a\u6307\u9488&#xff08;\u5bf9\u8c61\u6ca1\u521b\u5efa\u5c31\u7528&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>InputMismatchException<\/td>\n<td>Scanner \u8bfb\u53d6\u6570\u636e\u7c7b\u578b\u4e0d\u5339\u914d&#xff08;\u7528nextInt()\u8bfb\u4e86\u5b57\u6bcd&#xff09;<\/td>\n<td>\u8f93\u5165\u7684\u7c7b\u578b\u4e0d\u5bf9<\/td>\n<\/tr>\n<tr>\n<td>ClassCastException<\/td>\n<td>\u9519\u8bef\u7684\u7c7b\u578b\u8f6c\u6362&#xff08;Object o &#061; &#034;abc&#034;; int a &#061; (int)o;&#xff09;<\/td>\n<td>\u7c7b\u578b\u5f3a\u8f6c\u5931\u8d25<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4 id=\"2.%20%E7%BC%96%E8%AF%91%E6%97%B6%E5%BC%82%E5%B8%B8%EF%BC%88%E6%A3%80%E6%9F%A5%E5%9E%8B%E5%BC%82%E5%B8%B8%EF%BC%89%E2%80%94%E2%80%94%20%E7%BC%96%E8%AF%91%E5%99%A8%E5%BC%BA%E5%88%B6%E8%A6%81%E6%B1%82%E5%A4%84%E7%90%86%EF%BC%8C%E4%B8%8D%E5%A4%84%E7%90%86%E7%BC%96%E8%AF%91%E6%8A%A5%E9%94%99\">2. \u7f16\u8bd1\u65f6\u5f02\u5e38&#xff08;\u68c0\u67e5\u578b\u5f02\u5e38&#xff09;\u2014\u2014 \u7f16\u8bd1\u5668\u5f3a\u5236\u8981\u6c42\u5904\u7406&#xff0c;\u4e0d\u5904\u7406\u7f16\u8bd1\u62a5\u9519<\/h4>\n<h5 id=\"%E6%A0%B8%E5%BF%83%E7%89%B9%E7%82%B9\">\u6838\u5fc3\u7279\u70b9<\/h5>\n<ul>\n<li>\u7f16\u8bd1\u65f6\u5fc5\u987b\u624b\u52a8\u5904\u7406&#xff0c;\u5426\u5219\u4ee3\u7801\u8fde\u7f16\u8bd1\u90fd\u901a\u4e0d\u8fc7&#xff08;\u7f16\u8bd1\u5668\u76f4\u63a5\u6807\u7ea2&#xff09;&#xff1b;<\/li>\n<li>\u9519\u8bef\u901a\u5e38\u662f\u7a0b\u5e8f\u5916\u90e8\u7684\u5ba2\u89c2\u539f\u56e0\u5bfc\u81f4&#xff0c;\u4e0d\u662f\u7a0b\u5e8f\u5458\u7c97\u5fc3&#xff08;\u6bd4\u5982\u8981\u8bfb\u7684\u6587\u4ef6\u88ab\u5220\u4e86\u3001\u7f51\u7edc\u65ad\u4e86&#xff09;&#xff1b;<\/li>\n<li>\u5c5e\u4e8e \u201c\u53ef\u9884\u89c1\u7684\u610f\u5916\u201d&#xff0c;Java \u5f3a\u5236\u8981\u6c42\u7a0b\u5e8f\u5458\u63d0\u524d\u505a\u5904\u7406&#xff08;\u6bd4\u5982\u6587\u4ef6\u4e0d\u5b58\u5728\u8981\u63d0\u793a&#xff0c;\u4e0d\u80fd\u8ba9\u7a0b\u5e8f\u76f4\u63a5\u5d29&#xff09;\u3002<\/li>\n<\/ul>\n<h5 id=\"%E5%B8%B8%E8%A7%81%E4%BE%8B%E5%AD%90%EF%BC%88%E8%AE%B0%E8%BF%99%203%20%E4%B8%AA%EF%BC%8C%E8%A6%86%E7%9B%96%E5%BC%80%E5%8F%91%E5%B8%B8%E7%94%A8%E5%9C%BA%E6%99%AF%EF%BC%89\">\u5e38\u89c1\u4f8b\u5b50&#xff08;\u8bb0\u8fd9 3 \u4e2a&#xff0c;\u8986\u76d6\u5f00\u53d1\u5e38\u7528\u573a\u666f&#xff09;<\/h5>\n<table>\n<tr>\u5f02\u5e38\u540d\u79f0\u89e6\u53d1\u573a\u666f\u5927\u767d\u8bdd\u89e3\u91ca<\/tr>\n<tbody>\n<tr>\n<td>IOException<\/td>\n<td>\u6587\u4ef6\u8bfb\u53d6 \/ \u5199\u5165\u3001\u63a7\u5236\u53f0\u8f93\u5165\u8f93\u51fa\u5f02\u5e38<\/td>\n<td>IO \u64cd\u4f5c&#xff08;\u6587\u4ef6 \/ \u6d41&#xff09;\u9519\u8bef<\/td>\n<\/tr>\n<tr>\n<td>FileNotFoundException<\/td>\n<td>\u8bfb\u53d6\u6587\u4ef6\u65f6&#xff0c;\u6587\u4ef6\u4e0d\u5b58\u5728<\/td>\n<td>\u6587\u4ef6\u6ca1\u627e\u5230<\/td>\n<\/tr>\n<tr>\n<td>SQLException<\/td>\n<td>\u8fde\u63a5\u6570\u636e\u5e93\u3001\u64cd\u4f5c\u6570\u636e\u5e93\u8868\u5931\u8d25<\/td>\n<td>\u6570\u636e\u5e93\u64cd\u4f5c\u9519\u8bef<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4 id=\"%E4%B8%A4%E7%B1%BB%E5%BC%82%E5%B8%B8%E6%A0%B8%E5%BF%83%E5%AF%B9%E6%AF%94%EF%BC%88%E4%B8%80%E5%BC%A0%E8%A1%A8%E8%AE%B0%E7%89%A2%EF%BC%89\">\u4e24\u7c7b\u5f02\u5e38\u6838\u5fc3\u5bf9\u6bd4&#xff08;\u4e00\u5f20\u8868\u8bb0\u7262&#xff09;<\/h4>\n<table>\n<tr>\u5bf9\u6bd4\u7ef4\u5ea6\u8fd0\u884c\u65f6\u5f02\u5e38&#xff08;\u975e\u68c0\u67e5\u578b&#xff09;\u7f16\u8bd1\u65f6\u5f02\u5e38&#xff08;\u68c0\u67e5\u578b&#xff09;<\/tr>\n<tbody>\n<tr>\n<td>\u7f16\u8bd1\u8981\u6c42<\/td>\n<td>\u4e0d\u5f3a\u5236\u5904\u7406&#xff0c;\u7f16\u8bd1\u4e0d\u62a5\u9519<\/td>\n<td>\u5fc5\u987b\u5904\u7406&#xff0c;\u4e0d\u5904\u7406\u7f16\u8bd1\u62a5\u9519<\/td>\n<\/tr>\n<tr>\n<td>\u89e6\u53d1\u539f\u56e0<\/td>\n<td>\u7a0b\u5e8f\u5458\u4ee3\u7801\u758f\u5ffd&#xff08;\u4e3b\u89c2&#xff09;<\/td>\n<td>\u7a0b\u5e8f\u5916\u90e8\u5ba2\u89c2\u539f\u56e0&#xff08;\u5ba2\u89c2&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>\u5904\u7406\u4f18\u5148\u7ea7<\/td>\n<td>\u5efa\u8bae\u5904\u7406&#xff0c;\u907f\u514d\u7a0b\u5e8f\u8fd0\u884c\u5d29<\/td>\n<td>\u5fc5\u987b\u5904\u7406&#xff0c;\u5426\u5219\u4ee3\u7801\u65e0\u6cd5\u8fd0\u884c<\/td>\n<\/tr>\n<tr>\n<td>\u5e38\u89c1\u89e6\u53d1\u9636\u6bb5<\/td>\n<td>\u8fd0\u884c\u65f6<\/td>\n<td>\u7f16\u8bd1\u65f6\u68c0\u67e5&#xff0c;\u8fd0\u884c\u65f6\u89e6\u53d1<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3 id=\"%E4%B8%89%E3%80%81%E5%BC%82%E5%B8%B8%E5%A4%84%E7%90%86%E7%9A%84%203%20%E4%B8%AA%E6%A0%B8%E5%BF%83%E5%85%B3%E9%94%AE%E5%AD%97%20%E2%80%94%E2%80%94try%E3%80%81catch%E3%80%81finally%EF%BC%88%E9%9B%B6%E5%9F%BA%E7%A1%80%E5%BF%85%E5%AD%A6%EF%BC%89\">\u4e09\u3001\u5f02\u5e38\u5904\u7406\u7684 3 \u4e2a\u6838\u5fc3\u5173\u952e\u5b57 \u2014\u2014try\u3001catch\u3001finally&#xff08;\u96f6\u57fa\u7840\u5fc5\u5b66&#xff09;<\/h3>\n<p>\u8fd9\u662f Java \u5904\u7406\u5f02\u5e38\u7684\u57fa\u7840\u6838\u5fc3\u8bed\u6cd5&#xff0c;\u4e5f\u662f\u6700\u5e38\u7528\u7684\u65b9\u5f0f&#xff0c;\u4f5c\u7528\u662f\u300c\u6355\u83b7\u5f02\u5e38\u2192\u5904\u7406\u5f02\u5e38\u2192\u4fdd\u8bc1\u6536\u5c3e\u64cd\u4f5c\u6267\u884c\u300d&#xff0c;\u4e09\u8005\u914d\u5408\u4f7f\u7528&#xff0c;\u8bed\u6cd5\u56fa\u5b9a&#xff0c;\u80cc\u4f1a\u6a21\u677f\u76f4\u63a5\u5957\u5c31\u884c\u3002<\/p>\n<h4 id=\"%E6%A0%B8%E5%BF%83%E6%80%9D%E6%83%B3\">\u6838\u5fc3\u601d\u60f3<\/h4>\n<p>\u628a\u53ef\u80fd\u89e6\u53d1\u5f02\u5e38\u7684\u4ee3\u7801\u653e\u8fdbtry\u5757&#xff0c;\u628a\u5f02\u5e38\u53d1\u751f\u540e\u7684\u5904\u7406\u903b\u8f91\u653e\u8fdbcatch\u5757&#xff0c;\u628a\u65e0\u8bba\u662f\u5426\u53d1\u751f\u5f02\u5e38\u90fd\u5fc5\u987b\u6267\u884c\u7684\u6536\u5c3e\u4ee3\u7801\u653e\u8fdbfinally\u5757&#xff08;\u6bd4\u5982\u5173\u95ed\u6587\u4ef6\u3001\u5173\u95ed Scanner&#xff09;\u3002<\/p>\n<h4 id=\"%E5%9F%BA%E7%A1%80%E8%AF%AD%E6%B3%95%E6%A8%A1%E6%9D%BF%EF%BC%88%E6%AD%BB%E8%AE%B0%E7%A1%AC%E8%83%8C%EF%BC%8C%E7%9B%B4%E6%8E%A5%E5%A5%97%E7%94%A8%EF%BC%89\">\u57fa\u7840\u8bed\u6cd5\u6a21\u677f<\/h4>\n<p>try {<br \/>\n    \/\/ \u7b2c\u4e00\u6b65&#xff1a;\u653e\u3010\u53ef\u80fd\u89e6\u53d1\u5f02\u5e38\u3011\u7684\u4ee3\u7801<br \/>\n    \/\/ \u6bd4\u5982&#xff1a;\u9664\u4ee50\u3001Scanner\u8bfb\u53d6\u3001\u6587\u4ef6\u8bfb\u53d6\u7b49<br \/>\n    \u53ef\u80fd\u51fa\u95ee\u9898\u7684\u4ee3\u7801;<br \/>\n} catch (\u5f02\u5e38\u7c7b\u578b \u5f02\u5e38\u53d8\u91cf\u540d) {<br \/>\n    \/\/ \u7b2c\u4e8c\u6b65&#xff1a;\u6355\u83b7\u6307\u5b9a\u7c7b\u578b\u7684\u5f02\u5e38&#xff0c;\u53d1\u751f\u65f6\u6267\u884c\u8fd9\u91cc\u7684\u4ee3\u7801<br \/>\n    \/\/ \u6bd4\u5982&#xff1a;\u6253\u5370\u9519\u8bef\u4fe1\u606f\u3001\u7ed9\u7528\u6237\u63d0\u793a\u3001\u91cd\u65b0\u8d4b\u503c\u7b49<br \/>\n    \u5f02\u5e38\u5904\u7406\u903b\u8f91; \/\/ \u5982System.out.println(&#034;\u51fa\u9519\u4e86&#xff01;&#034;);<br \/>\n} finally {<br \/>\n    \/\/ \u7b2c\u4e09\u6b65&#xff1a;\u65e0\u8bba\u662f\u5426\u53d1\u751f\u5f02\u5e38&#xff0c;\u8fd9\u91cc\u7684\u4ee3\u7801\u3010\u4e00\u5b9a\u6267\u884c\u3011<br \/>\n    \/\/ \u4f5c\u7528&#xff1a;\u6536\u5c3e\u64cd\u4f5c&#xff08;\u5173\u95ed\u8d44\u6e90\u3001\u91ca\u653e\u5185\u5b58&#xff09;<br \/>\n    \u5fc5\u987b\u6267\u884c\u7684\u6536\u5c3e\u4ee3\u7801; \/\/ \u5982sc.close();\u3001\u5173\u95ed\u6587\u4ef6\u6d41\u7b49<br \/>\n}<\/p>\n<h4 id=\"%E5%85%B3%E9%94%AE%E8%A7%84%E5%88%99%EF%BC%88%E9%9B%B6%E5%9F%BA%E7%A1%80%E5%BF%85%E7%9C%8B%EF%BC%8C%E9%81%BF%E5%85%8D%E8%B8%A9%E5%9D%91%EF%BC%89\">\u5173\u952e\u89c4\u5219&#xff08;\u96f6\u57fa\u7840\u5fc5\u770b&#xff0c;\u907f\u514d\u8e29\u5751&#xff09;<\/h4>\n<li>try\u5757\u4e0d\u80fd\u5355\u72ec\u5b58\u5728&#xff0c;\u5fc5\u987b\u8ddfcatch\u3001finally\u81f3\u5c11\u4e00\u4e2a\u914d\u5408&#xff08;try-catch \/ try-finally \/ try-catch-finally&#xff09;&#xff1b;<\/li>\n<li>catch\u5757\u53ef\u4ee5\u5199\u591a\u4e2a&#xff0c;\u6355\u83b7\u4e0d\u540c\u7c7b\u578b\u7684\u5f02\u5e38&#xff08;\u9488\u5bf9\u6027\u5904\u7406&#xff09;&#xff1b;<\/li>\n<li>finally\u5757\u53ef\u9009&#xff0c;\u4f46\u53ea\u8981\u5199\u4e86&#xff0c;\u65e0\u8bbatry\u91cc\u662f\u5426\u62a5\u9519\u3001catch\u91cc\u662f\u5426\u6267\u884c\u3001\u751a\u81f3\u6709return&#xff0c;\u90fd\u4f1a\u6267\u884c&#xff1b;<\/li>\n<li>\u5f02\u5e38\u53d8\u91cf\u540d\u4e00\u822c\u5199e&#xff08;\u7ea6\u5b9a\u4fd7\u6210&#xff0c;\u5927\u5bb6\u90fd\u8fd9\u4e48\u5199&#xff09;&#xff0c;\u53ef\u4ee5\u901a\u8fc7e.getMessage()\u83b7\u53d6\u5f02\u5e38\u7684\u5177\u4f53\u539f\u56e0&#xff0c;e.printStackTrace()\u6253\u5370\u8be6\u7ec6\u7684\u9519\u8bef\u4fe1\u606f&#xff08;\u8c03\u8bd5\u7528&#xff09;\u3002<\/li>\n<h4 id=\"%E5%85%A5%E9%97%A8%E7%A4%BA%E4%BE%8B%201%EF%BC%9A%E5%A4%84%E7%90%86%E8%BF%90%E8%A1%8C%E6%97%B6%E5%BC%82%E5%B8%B8%EF%BC%88%E9%99%A4%E4%BB%A5%200%EF%BC%8CArithmeticException%EF%BC%89\">\u5165\u95e8\u793a\u4f8b 1&#xff1a;\u5904\u7406\u8fd0\u884c\u65f6\u5f02\u5e38&#xff08;\u9664\u4ee5 0&#xff0c;ArithmeticException&#xff09;<\/h4>\n<p>\u6700\u57fa\u7840\u7684try-catch-finally\u7528\u6cd5&#xff0c;\u5904\u7406\u65b0\u624b\u6700\u5bb9\u6613\u72af\u7684 \u201c\u9664\u4ee5 0\u201d \u9519\u8bef&#xff1a;<\/p>\n<p>public class ExceptionTest1 {<br \/>\n    public static void main(String[] args) {<br \/>\n        int a &#061; 10;<br \/>\n        int b &#061; 0;<br \/>\n        int result &#061; 0; \/\/ \u521d\u59cb\u5316\u7ed3\u679c&#xff0c;\u907f\u514d\u672a\u8d4b\u503c\u62a5\u9519<\/p>\n<p>        try {<br \/>\n            \/\/ \u53ef\u80fd\u51fa\u95ee\u9898\u7684\u4ee3\u7801&#xff1a;\u9664\u4ee50&#xff0c;\u4f1a\u89e6\u53d1ArithmeticException<br \/>\n            result &#061; a \/ b;<br \/>\n            System.out.println(&#034;\u4e24\u6570\u76f8\u9664\u7ed3\u679c&#xff1a;&#034; &#043; result); \/\/ \u5f02\u5e38\u540e&#xff0c;\u8fd9\u884c\u4ee3\u7801\u4e0d\u4f1a\u6267\u884c<br \/>\n        } catch (ArithmeticException e) {<br \/>\n            \/\/ \u6355\u83b7\u7b97\u672f\u5f02\u5e38&#xff0c;\u5904\u7406\u903b\u8f91&#xff1a;\u63d0\u793a\u9519\u8bef<br \/>\n            System.out.println(&#034;\u51fa\u9519\u5566&#xff01;\u539f\u56e0&#xff1a;\u4e0d\u80fd\u9664\u4ee50&#034;);<br \/>\n            \/\/ \u53ef\u9009&#xff1a;\u6253\u5370\u8be6\u7ec6\u9519\u8bef\u4fe1\u606f&#xff08;\u5f00\u53d1\u8c03\u8bd5\u7528&#xff0c;\u4e0a\u7ebf\u540e\u53ef\u6ce8\u91ca&#xff09;<br \/>\n            \/\/ e.printStackTrace();<br \/>\n        } finally {<br \/>\n            \/\/ \u65e0\u8bba\u662f\u5426\u51fa\u9519&#xff0c;\u4e00\u5b9a\u6267\u884c&#xff1a;\u6536\u5c3e\u63d0\u793a<br \/>\n            System.out.println(&#034;\u5f02\u5e38\u5904\u7406\u4ee3\u7801\u6267\u884c\u5b8c\u6bd5&#034;);<br \/>\n        }<\/p>\n<p>        \/\/ \u6709\u5f02\u5e38\u5904\u7406&#xff0c;\u7a0b\u5e8f\u4e0d\u4f1a\u7ec8\u6b62&#xff0c;\u8fd9\u91cc\u80fd\u6b63\u5e38\u6267\u884c<br \/>\n        System.out.println(&#034;\u7a0b\u5e8f\u7ee7\u7eed\u8fd0\u884c&#xff0c;\u4e0d\u53d7\u5f02\u5e38\u5f71\u54cd&#034;);<br \/>\n    }<br \/>\n}<\/p>\n<p>\u8fd0\u884c\u7ed3\u679c&#xff1a;<\/p>\n<p>\u51fa\u9519\u5566&#xff01;\u539f\u56e0&#xff1a;\u4e0d\u80fd\u9664\u4ee50<br \/>\n\u5f02\u5e38\u5904\u7406\u4ee3\u7801\u6267\u884c\u5b8c\u6bd5<br \/>\n\u7a0b\u5e8f\u7ee7\u7eed\u8fd0\u884c&#xff0c;\u4e0d\u53d7\u5f02\u5e38\u5f71\u54cd<\/p>\n<p>\u2705 \u6548\u679c&#xff1a;\u539f\u672c\u4f1a\u8ba9\u7a0b\u5e8f\u7ec8\u6b62\u7684 \u201c\u9664\u4ee5 0\u201d \u9519\u8bef&#xff0c;\u88ab\u6355\u83b7\u5904\u7406\u540e&#xff0c;\u7a0b\u5e8f\u80fd\u7ee7\u7eed\u8fd0\u884c&#xff01;<\/p>\n<h4 id=\"%E5%85%A5%E9%97%A8%E7%A4%BA%E4%BE%8B%202%EF%BC%9A%E5%A4%9A%20catch%20%E5%9D%97%EF%BC%88%E5%A4%84%E7%90%86%E5%A4%9A%E7%A7%8D%E4%B8%8D%E5%90%8C%E5%BC%82%E5%B8%B8%EF%BC%89\">\u5165\u95e8\u793a\u4f8b 2&#xff1a;\u591a catch \u5757&#xff08;\u5904\u7406\u591a\u79cd\u4e0d\u540c\u5f02\u5e38&#xff09;<\/h4>\n<p>\u5f53try\u91cc\u7684\u4ee3\u7801\u53ef\u80fd\u89e6\u53d1\u591a\u79cd\u5f02\u5e38\u65f6&#xff0c;\u5199\u591a\u4e2acatch\u5757&#xff0c;\u9488\u5bf9\u6027\u5904\u7406&#xff08;\u6bd4\u5982\u540c\u65f6\u53ef\u80fd\u9664\u4ee5 0\u3001\u7a7a\u6307\u9488&#xff09;&#xff1a;<\/p>\n<p>public class ExceptionTest2 {<br \/>\n    public static void main(String[] args) {<br \/>\n        int a &#061; 10;<br \/>\n        int b &#061; 0;<br \/>\n        String s &#061; null; \/\/ \u7a7a\u5b57\u7b26\u4e32&#xff0c;\u8c03\u7528length()\u4f1a\u89e6\u53d1\u7a7a\u6307\u9488<\/p>\n<p>        try {<br \/>\n            int result &#061; a \/ b; \/\/ \u53ef\u80fd\u89e6\u53d1ArithmeticException<br \/>\n            s.length(); \/\/ \u53ef\u80fd\u89e6\u53d1NullPointerException&#xff08;\u82e5\u4e0a\u9762\u4ee3\u7801\u6ca1\u89e6\u53d1\u5f02\u5e38&#xff09;<br \/>\n        } catch (ArithmeticException e) {<br \/>\n            \/\/ \u4e13\u95e8\u5904\u7406\u9664\u4ee50\u5f02\u5e38<br \/>\n            System.out.println(&#034;\u5904\u7406\u7b97\u672f\u5f02\u5e38&#xff1a;\u4e0d\u80fd\u9664\u4ee50&#034;);<br \/>\n        } catch (NullPointerException e) {<br \/>\n            \/\/ \u4e13\u95e8\u5904\u7406\u7a7a\u6307\u9488\u5f02\u5e38<br \/>\n            System.out.println(&#034;\u5904\u7406\u7a7a\u6307\u9488\u5f02\u5e38&#xff1a;\u5bf9\u8c61\u4e0d\u80fd\u4e3anull&#034;);<br \/>\n        } catch (Exception e) {<br \/>\n            \/\/ \u4e07\u80fd\u5f02\u5e38\u6355\u83b7&#xff1a;\u6240\u6709\u5f02\u5e38\u7684\u7236\u7c7b&#xff0c;\u6355\u83b7\u4e0a\u9762\u6ca1\u5199\u5230\u7684\u5176\u4ed6\u5f02\u5e38<br \/>\n            System.out.println(&#034;\u5904\u7406\u5176\u4ed6\u672a\u77e5\u5f02\u5e38&#xff1a;&#034; &#043; e.getMessage());<br \/>\n        } finally {<br \/>\n            System.out.println(&#034;\u591acatch\u5757\u7684\u6536\u5c3e\u64cd\u4f5c&#034;);<br \/>\n        }<br \/>\n    }<br \/>\n}<\/p>\n<p>\u8fd0\u884c\u7ed3\u679c&#xff1a;<\/p>\n<p>\u5904\u7406\u7b97\u672f\u5f02\u5e38&#xff1a;\u4e0d\u80fd\u9664\u4ee50<br \/>\n\u591acatch\u5757\u7684\u6536\u5c3e\u64cd\u4f5c<\/p>\n<p>\u2705 \u5173\u952e&#xff1a;Exception\u662f\u6240\u6709 Java \u5f02\u5e38\u7684\u7236\u7c7b&#xff0c;\u5199\u5728\u6700\u540e\u4e00\u4e2acatch\u5757&#xff0c;\u80fd\u6355\u83b7\u6240\u6709\u672a\u660e\u786e\u58f0\u660e\u7684\u5f02\u5e38&#xff0c;\u907f\u514d\u6f0f\u6355\u3002<\/p>\n<h4 id=\"%E5%85%A5%E9%97%A8%E7%A4%BA%E4%BE%8B%203%EF%BC%9Afinally%20%E7%9A%84%E6%A0%B8%E5%BF%83%E4%BD%9C%E7%94%A8%20%E2%80%94%E2%80%94%20%E9%87%8A%E6%94%BE%E8%B5%84%E6%BA%90%EF%BC%88%E5%BF%85%E7%94%A8%E5%9C%BA%E6%99%AF%EF%BC%89\">\u5165\u95e8\u793a\u4f8b 3&#xff1a;finally \u7684\u6838\u5fc3\u4f5c\u7528 \u2014\u2014 \u91ca\u653e\u8d44\u6e90&#xff08;\u5fc5\u7528\u573a\u666f&#xff09;<\/h4>\n<p>\u5f00\u53d1\u4e2dfinally\u6700\u5e38\u7528\u7684\u573a\u666f\u662f\u5173\u95ed\u8d44\u6e90&#xff08;\u6bd4\u5982 Scanner\u3001\u6587\u4ef6\u6d41\u3001\u6570\u636e\u5e93\u8fde\u63a5&#xff09;&#xff0c;\u65e0\u8bba\u662f\u5426\u53d1\u751f\u5f02\u5e38&#xff0c;\u8d44\u6e90\u5fc5\u987b\u5173\u95ed&#xff0c;\u5426\u5219\u4f1a\u5360\u7528\u7cfb\u7edf\u5185\u5b58&#xff0c;\u8fd9\u662f\u7f16\u7a0b\u597d\u4e60\u60ef&#xff01;<\/p>\n<p>import java.util.Scanner;<br \/>\nimport java.util.InputMismatchException;<\/p>\n<p>public class ExceptionTest3 {<br \/>\n    public static void main(String[] args) {<br \/>\n        Scanner sc &#061; null; \/\/ \u5148\u58f0\u660e\u4e3anull&#xff0c;\u65b9\u4fbffinally\u4e2d\u5173\u95ed<br \/>\n        try {<br \/>\n            sc &#061; new Scanner(System.in);<br \/>\n            System.out.print(&#034;\u8bf7\u8f93\u5165\u4e00\u4e2a\u6574\u6570&#xff1a;&#034;);<br \/>\n            int num &#061; sc.nextInt(); \/\/ \u8f93\u5165\u5b57\u6bcd\u4f1a\u89e6\u53d1InputMismatchException<br \/>\n            System.out.println(&#034;\u4f60\u8f93\u5165\u7684\u6574\u6570\u662f&#xff1a;&#034; &#043; num);<br \/>\n        } catch (InputMismatchException e) {<br \/>\n            System.out.println(&#034;\u51fa\u9519\u5566&#xff01;\u4f60\u8f93\u5165\u7684\u4e0d\u662f\u6574\u6570&#034;);<br \/>\n        } finally {<br \/>\n            \/\/ \u65e0\u8bba\u662f\u5426\u8f93\u5165\u6b63\u786e&#xff0c;\u90fd\u5173\u95edScanner&#xff0c;\u91ca\u653e\u8f93\u5165\u6d41\u8d44\u6e90<br \/>\n            if (sc !&#061; null) { \/\/ \u5224\u7a7a&#xff1a;\u907f\u514dsc\u4e3anull\u65f6\u8c03\u7528close()\u89e6\u53d1\u7a7a\u6307\u9488<br \/>\n                sc.close();<br \/>\n                System.out.println(&#034;Scanner\u5df2\u5173\u95ed&#xff0c;\u8d44\u6e90\u91ca\u653e&#034;);<br \/>\n            }<br \/>\n        }<br \/>\n    }<br \/>\n}<\/p>\n<p>\u8fd0\u884c\u573a\u666f 1&#xff1a;\u8f93\u5165\u6b63\u786e&#xff08;\u6574\u6570 10&#xff09;<\/p>\n<p>\u8bf7\u8f93\u5165\u4e00\u4e2a\u6574\u6570&#xff1a;10<br \/>\n\u4f60\u8f93\u5165\u7684\u6574\u6570\u662f&#xff1a;10<br \/>\nScanner\u5df2\u5173\u95ed&#xff0c;\u8d44\u6e90\u91ca\u653e<\/p>\n<p>\u8fd0\u884c\u573a\u666f 2&#xff1a;\u8f93\u5165\u9519\u8bef&#xff08;\u5b57\u6bcd a&#xff09;<\/p>\n<p>\u8bf7\u8f93\u5165\u4e00\u4e2a\u6574\u6570&#xff1a;a<br \/>\n\u51fa\u9519\u5566&#xff01;\u4f60\u8f93\u5165\u7684\u4e0d\u662f\u6574\u6570<br \/>\nScanner\u5df2\u5173\u95ed&#xff0c;\u8d44\u6e90\u91ca\u653e<\/p>\n<p>\u2705 \u6548\u679c&#xff1a;\u65e0\u8bba\u8f93\u5165\u662f\u5426\u6b63\u786e&#xff08;\u662f\u5426\u89e6\u53d1\u5f02\u5e38&#xff09;&#xff0c;finally\u91cc\u7684\u5173\u95ed\u8d44\u6e90\u4ee3\u7801\u4e00\u5b9a\u4f1a\u6267\u884c&#xff01;<\/p>\n<h3 id=\"%E5%9B%9B%E3%80%81%E5%A4%84%E7%90%86%E7%BC%96%E8%AF%91%E6%97%B6%E5%BC%82%E5%B8%B8%E7%9A%84%202%20%E7%A7%8D%E6%96%B9%E5%BC%8F%EF%BC%88%E7%BC%96%E8%AF%91%E5%99%A8%E5%BC%BA%E5%88%B6%E8%A6%81%E6%B1%82%EF%BC%8C%E4%BA%8C%E9%80%89%E4%B8%80%EF%BC%89\">\u56db\u3001\u5904\u7406\u7f16\u8bd1\u65f6\u5f02\u5e38\u7684 2 \u79cd\u65b9\u5f0f&#xff08;\u7f16\u8bd1\u5668\u5f3a\u5236\u8981\u6c42&#xff0c;\u4e8c\u9009\u4e00&#xff09;<\/h3>\n<p>\u7f16\u8bd1\u65f6\u5f02\u5e38&#xff08;\u5982 IOException&#xff09;\u7684\u7279\u70b9\u662f\u4e0d\u5904\u7406\u7f16\u8bd1\u5c31\u62a5\u9519&#xff0c;Java \u63d0\u4f9b\u4e862 \u79cd\u5408\u6cd5\u5904\u7406\u65b9\u5f0f&#xff0c;\u96f6\u57fa\u7840\u8bb0\u4f4f \u201c\u4e8c\u9009\u4e00\u201d \u5373\u53ef&#xff0c;\u4e0d\u7528\u7ea0\u7ed3&#xff0c;\u6839\u636e\u573a\u666f\u9009\u62e9\u3002<\/p>\n<h4 id=\"%E6%96%B9%E5%BC%8F%201%EF%BC%9Atry-catch-finally%20%E6%8D%95%E8%8E%B7%E5%A4%84%E7%90%86%EF%BC%88%E6%8E%A8%E8%8D%90%EF%BC%8C%E4%B8%BB%E5%8A%A8%E5%A4%84%E7%90%86%E5%BC%82%E5%B8%B8%EF%BC%89\">\u65b9\u5f0f 1&#xff1a;try-catch-finally \u6355\u83b7\u5904\u7406&#xff08;\u63a8\u8350&#xff0c;\u4e3b\u52a8\u5904\u7406\u5f02\u5e38&#xff09;<\/h4>\n<p>\u548c\u5904\u7406\u8fd0\u884c\u65f6\u5f02\u5e38\u7684\u8bed\u6cd5\u5b8c\u5168\u4e00\u6837&#xff0c;\u628a\u53ef\u80fd\u89e6\u53d1\u7f16\u8bd1\u65f6\u5f02\u5e38\u7684\u4ee3\u7801\u653e\u8fdbtry\u5757&#xff0c;catch\u5757\u5904\u7406\u5373\u53ef&#xff0c;\u7f16\u8bd1\u5668\u5c31\u4e0d\u4f1a\u62a5\u9519\u4e86\u3002<\/p>\n<h5 id=\"%E7%A4%BA%E4%BE%8B%EF%BC%9A%E5%A4%84%E7%90%86%E6%8E%A7%E5%88%B6%E5%8F%B0%E8%BE%93%E5%85%A5%E7%9A%84%20IOException%EF%BC%88%E7%BC%96%E8%AF%91%E6%97%B6%E5%BC%82%E5%B8%B8%EF%BC%89\">\u793a\u4f8b&#xff1a;\u5904\u7406\u63a7\u5236\u53f0\u8f93\u5165\u7684 IOException&#xff08;\u7f16\u8bd1\u65f6\u5f02\u5e38&#xff09;<\/h5>\n<p>\/\/ \u5fc5\u987b\u5bfc\u5165io\u5305&#xff0c;\u5426\u5219\u7f16\u8bd1\u62a5\u9519<br \/>\nimport java.io.BufferedReader;<br \/>\nimport java.io.InputStreamReader;<br \/>\nimport java.io.IOException; \/\/ \u7f16\u8bd1\u65f6\u5f02\u5e38<\/p>\n<p>public class CheckedExceptionTest1 {<br \/>\n    public static void main(String[] args) {<br \/>\n        BufferedReader br &#061; null;<br \/>\n        try {<br \/>\n            \/\/ \u8fd9\u884c\u4ee3\u7801\u4f1a\u89e6\u53d1IOException&#xff08;\u7f16\u8bd1\u65f6\u5f02\u5e38&#xff09;&#xff0c;\u5fc5\u987b\u5904\u7406<br \/>\n            br &#061; new BufferedReader(new InputStreamReader(System.in));<br \/>\n            System.out.print(&#034;\u8bf7\u8f93\u5165\u4e00\u53e5\u8bdd&#xff1a;&#034;);<br \/>\n            String line &#061; br.readLine();<br \/>\n            System.out.println(&#034;\u4f60\u8f93\u5165\u7684\u662f&#xff1a;&#034; &#043; line);<br \/>\n        } catch (IOException e) {<br \/>\n            \/\/ \u6355\u83b7\u5e76\u5904\u7406IOException<br \/>\n            System.out.println(&#034;\u8f93\u5165\u5f02\u5e38&#xff1a;&#034; &#043; e.getMessage());<br \/>\n        } finally {<br \/>\n            \/\/ \u5173\u95ed\u8d44\u6e90&#xff0c;\u907f\u514d\u5185\u5b58\u6cc4\u6f0f<br \/>\n            if (br !&#061; null) {<br \/>\n                try {<br \/>\n                    br.close(); \/\/ close()\u4e5f\u4f1a\u89e6\u53d1IOException&#xff0c;\u5d4c\u5957try-catch\u5373\u53ef<br \/>\n                } catch (IOException e) {<br \/>\n                    e.printStackTrace();<br \/>\n                }<br \/>\n            }<br \/>\n        }<br \/>\n    }<br \/>\n}<\/p>\n<p>\u2705 \u6548\u679c&#xff1a;\u7528try-catch\u6355\u83b7\u540e&#xff0c;\u7f16\u8bd1\u5668\u4e0d\u518d\u62a5\u9519&#xff0c;\u7a0b\u5e8f\u6b63\u5e38\u7f16\u8bd1\u8fd0\u884c\u3002<\/p>\n<h4 id=\"%E6%96%B9%E5%BC%8F%202%EF%BC%9Athrows%20%E5%A3%B0%E6%98%8E%E5%BC%82%E5%B8%B8%EF%BC%88%E7%94%A9%E9%94%85%EF%BC%8C%E6%8A%8A%E5%BC%82%E5%B8%B8%E4%BA%A4%E7%BB%99%E4%B8%8A%E5%B1%82%E5%A4%84%E7%90%86%EF%BC%89\">\u65b9\u5f0f 2&#xff1a;throws \u58f0\u660e\u5f02\u5e38&#xff08;\u7529\u9505&#xff0c;\u628a\u5f02\u5e38\u4ea4\u7ed9\u4e0a\u5c42\u5904\u7406&#xff09;<\/h4>\n<p>\u5728\u65b9\u6cd5\u540d\u540e\u9762\u52a0throws \u5f02\u5e38\u7c7b\u578b&#xff0c;\u8868\u793a \u201c\u8fd9\u4e2a\u65b9\u6cd5\u91cc\u53ef\u80fd\u89e6\u53d1\u8be5\u5f02\u5e38&#xff0c;\u6211\u4e0d\u5904\u7406&#xff0c;\u4ea4\u7ed9\u8c03\u7528\u8fd9\u4e2a\u65b9\u6cd5\u7684\u4e0a\u5c42\u4ee3\u7801\u5904\u7406\u201d\u3002<\/p>\n<ul>\n<li>\u82e5\u4e3b\u65b9\u6cd5&#xff08;main&#xff09;\u7528throws\u58f0\u660e&#xff0c;\u5c31\u8868\u793a\u628a\u5f02\u5e38\u4ea4\u7ed9JVM&#xff08;Java \u865a\u62df\u673a&#xff09; \u5904\u7406&#xff0c;JVM \u7684\u5904\u7406\u65b9\u5f0f\u662f&#xff1a;\u6253\u5370\u9519\u8bef\u4fe1\u606f&#xff0c;\u7ec8\u6b62\u7a0b\u5e8f&#xff08;\u548c\u672a\u5904\u7406\u8fd0\u884c\u65f6\u5f02\u5e38\u7684\u6548\u679c\u4e00\u6837&#xff09;&#xff1b;<\/li>\n<li>\u9002\u5408\u5feb\u901f\u5f00\u53d1\u3001\u6d4b\u8bd5\u573a\u666f&#xff0c;\u751f\u4ea7\u73af\u5883\u4e0d\u63a8\u8350\u4e3b\u65b9\u6cd5\u7528 throws&#xff08;\u4f1a\u5bfc\u81f4\u7a0b\u5e8f\u7ec8\u6b62&#xff09;\u3002<\/li>\n<\/ul>\n<h5 id=\"%E7%A4%BA%E4%BE%8B%EF%BC%9Amain%20%E6%96%B9%E6%B3%95%20throws%20%E5%A3%B0%E6%98%8E%20IOException%EF%BC%8C%E7%94%A9%E9%94%85%E7%BB%99%20JVM\">\u793a\u4f8b&#xff1a;main \u65b9\u6cd5 throws \u58f0\u660e IOException&#xff0c;\u7529\u9505\u7ed9 JVM<\/h5>\n<p>import java.io.BufferedReader;<br \/>\nimport java.io.InputStreamReader;<br \/>\nimport java.io.IOException;<\/p>\n<p>\/\/ main\u65b9\u6cd5\u540e\u52a0throws IOException&#xff0c;\u58f0\u660e\u8be5\u65b9\u6cd5\u53ef\u80fd\u629b\u51fa\u6b64\u5f02\u5e38&#xff0c;\u4ea4\u7ed9JVM\u5904\u7406<br \/>\npublic class CheckedExceptionTest2 {<br \/>\n    public static void main(String[] args) throws IOException {<br \/>\n        \/\/ \u89e6\u53d1IOException\u7684\u4ee3\u7801&#xff0c;\u65e0\u9700try-catch&#xff0c;\u7f16\u8bd1\u5668\u4e0d\u62a5\u9519<br \/>\n        BufferedReader br &#061; new BufferedReader(new InputStreamReader(System.in));<br \/>\n        System.out.print(&#034;\u8bf7\u8f93\u5165\u4e00\u53e5\u8bdd&#xff1a;&#034;);<br \/>\n        String line &#061; br.readLine();<br \/>\n        System.out.println(&#034;\u4f60\u8f93\u5165\u7684\u662f&#xff1a;&#034; &#043; line);<br \/>\n        br.close();<br \/>\n    }<br \/>\n}<\/p>\n<p>\u2705 \u6548\u679c&#xff1a;\u7f16\u8bd1\u5668\u4e0d\u62a5\u9519&#xff0c;\u7a0b\u5e8f\u80fd\u6b63\u5e38\u8fd0\u884c&#xff1b;\u82e5\u89e6\u53d1\u5f02\u5e38&#xff0c;JVM \u4f1a\u6253\u5370\u7ea2\u8272\u9519\u8bef\u4fe1\u606f&#xff0c;\u7a0b\u5e8f\u7ec8\u6b62\u3002<\/p>\n<h4 id=\"%E4%B8%A4%E7%A7%8D%E6%96%B9%E5%BC%8F%E5%AF%B9%E6%AF%94%EF%BC%88%E9%9B%B6%E5%9F%BA%E7%A1%80%E6%80%8E%E4%B9%88%E9%80%89%EF%BC%9F%EF%BC%89\">\u4e24\u79cd\u65b9\u5f0f\u5bf9\u6bd4&#xff08;\u96f6\u57fa\u7840\u600e\u4e48\u9009&#xff1f;&#xff09;<\/h4>\n<table>\n<tr>\u5904\u7406\u65b9\u5f0ftry-catch-finally \u6355\u83b7throws \u58f0\u660e\u5f02\u5e38<\/tr>\n<tbody>\n<tr>\n<td>\u6838\u5fc3\u601d\u60f3<\/td>\n<td>\u4e3b\u52a8\u5904\u7406&#xff0c;\u89e3\u51b3\u5f02\u5e38<\/td>\n<td>\u88ab\u52a8\u7529\u9505&#xff0c;\u4ea4\u7ed9\u4e0a\u5c42\u5904\u7406<\/td>\n<\/tr>\n<tr>\n<td>\u7a0b\u5e8f\u5f71\u54cd<\/td>\n<td>\u5f02\u5e38\u5904\u7406\u540e&#xff0c;\u7a0b\u5e8f\u53ef\u7ee7\u7eed\u8fd0\u884c<\/td>\n<td>\u4e0a\u5c42\u82e5\u672a\u5904\u7406&#xff0c;\u89e6\u53d1\u540e\u7a0b\u5e8f\u76f4\u63a5\u7ec8\u6b62<\/td>\n<\/tr>\n<tr>\n<td>\u9002\u7528\u573a\u666f<\/td>\n<td>\u751f\u4ea7\u73af\u5883\u3001\u9700\u8981\u7a0b\u5e8f\u4f18\u96c5\u8fd0\u884c\u7684\u573a\u666f<\/td>\n<td>\u6d4b\u8bd5\u573a\u666f\u3001\u5feb\u901f\u5f00\u53d1&#xff0c;\u65e0\u9700\u5904\u7406\u5f02\u5e38<\/td>\n<\/tr>\n<tr>\n<td>\u63a8\u8350\u7a0b\u5ea6<\/td>\n<td>\u9ad8&#xff08;\u5f00\u53d1\u9996\u9009&#xff09;<\/td>\n<td>\u4f4e&#xff08;\u4ec5\u4e34\u65f6\u4f7f\u7528&#xff09;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3 id=\"%E4%BA%94%E3%80%812%20%E4%B8%AA%E8%BF%9B%E9%98%B6%E5%85%B3%E9%94%AE%E5%AD%97%EF%BC%9Athrow%EF%BC%88%E4%B8%BB%E5%8A%A8%E6%8A%9B%E5%BC%82%E5%B8%B8%EF%BC%89%E3%80%81throws%EF%BC%88%E5%A3%B0%E6%98%8E%E5%BC%82%E5%B8%B8%EF%BC%89\">\u4e94\u30012 \u4e2a\u8fdb\u9636\u5173\u952e\u5b57&#xff1a;throw&#xff08;\u4e3b\u52a8\u629b\u5f02\u5e38&#xff09;\u3001throws&#xff08;\u58f0\u660e\u5f02\u5e38&#xff09;<\/h3>\n<p>\u96f6\u57fa\u7840\u638c\u63e1\u4e0a\u9762\u7684try-catch-finally\u5c31\u591f\u65e5\u5e38\u5f00\u53d1\u4e86&#xff0c;\u8fd9\u91cc\u7b80\u5355\u8bb2throw\u548cthrows\u7684\u533a\u522b&#xff08;\u5f88\u591a\u5c0f\u767d\u5bb9\u6613\u6df7\u6dc6&#xff09;&#xff0c;\u4e86\u89e3\u5373\u53ef&#xff0c;\u540e\u7eed\u8fdb\u9636\u518d\u6df1\u5165\u4f7f\u7528\u3002<\/p>\n<h4 id=\"1.%20throw%20%E2%80%94%E2%80%94%20%E6%89%8B%E5%8A%A8%20%2F%20%E4%B8%BB%E5%8A%A8%E6%8A%9B%E5%87%BA%E4%B8%80%E4%B8%AA%E5%BC%82%E5%B8%B8%EF%BC%88%E6%96%B9%E6%B3%95%E5%86%85%E9%83%A8%E7%94%A8%EF%BC%89\">1. throw \u2014\u2014 \u624b\u52a8 \/ \u4e3b\u52a8\u629b\u51fa\u4e00\u4e2a\u5f02\u5e38&#xff08;\u65b9\u6cd5\u5185\u90e8\u7528&#xff09;<\/h4>\n<h5 id=\"%E4%BD%9C%E7%94%A8\">\u4f5c\u7528<\/h5>\n<p>\u5728\u4ee3\u7801\u4e2d\u4e3b\u52a8\u89e6\u53d1\u4e00\u4e2a\u5f02\u5e38&#xff08;\u6bd4\u5982\u5224\u65ad\u7528\u6237\u8f93\u5165\u7684\u5e74\u9f84\u662f\u8d1f\u6570&#xff0c;\u4e3b\u52a8\u629b\u5f02\u5e38\u63d0\u793a&#xff09;&#xff0c;\u8ba9\u7a0b\u5e8f\u8fdb\u5165\u5f02\u5e38\u5904\u7406\u6d41\u7a0b\u3002<\/p>\n<h5 id=\"%E8%AF%AD%E6%B3%95\">\u8bed\u6cd5<\/h5>\n<p>throw new \u5f02\u5e38\u7c7b\u578b(&#034;\u5f02\u5e38\u63d0\u793a\u4fe1\u606f&#034;);<\/p>\n<h5 id=\"%E7%A4%BA%E4%BE%8B%EF%BC%9A%E4%B8%BB%E5%8A%A8%E6%8A%9B%E5%87%BA%E9%9D%9E%E6%B3%95%E5%8F%82%E6%95%B0%E5%BC%82%E5%B8%B8%EF%BC%88IllegalArgumentException%EF%BC%8C%E8%BF%90%E8%A1%8C%E6%97%B6%E5%BC%82%E5%B8%B8%EF%BC%89\">\u793a\u4f8b&#xff1a;\u4e3b\u52a8\u629b\u51fa\u975e\u6cd5\u53c2\u6570\u5f02\u5e38&#xff08;IllegalArgumentException&#xff0c;\u8fd0\u884c\u65f6\u5f02\u5e38&#xff09;<\/h5>\n<p>public class ThrowTest {<br \/>\n    public static void main(String[] args) {<br \/>\n        int age &#061; -10; \/\/ \u975e\u6cd5\u5e74\u9f84&#xff1a;\u8d1f\u6570<br \/>\n        try {<br \/>\n            \/\/ \u5224\u65ad\u5e74\u9f84\u975e\u6cd5&#xff0c;\u4e3b\u52a8\u629b\u5f02\u5e38<br \/>\n            if (age &lt; 0) {<br \/>\n                throw new IllegalArgumentException(&#034;\u5e74\u9f84\u4e0d\u80fd\u4e3a\u8d1f\u6570&#xff01;\u4f60\u8f93\u5165\u7684\u662f&#xff1a;&#034; &#043; age);<br \/>\n            }<br \/>\n            System.out.println(&#034;\u4f60\u7684\u5e74\u9f84\u662f&#xff1a;&#034; &#043; age);<br \/>\n        } catch (IllegalArgumentException e) {<br \/>\n            \/\/ \u6355\u83b7\u4e3b\u52a8\u629b\u51fa\u7684\u5f02\u5e38&#xff0c;\u5904\u7406\u63d0\u793a<br \/>\n            System.out.println(&#034;\u6355\u83b7\u5f02\u5e38&#xff1a;&#034; &#043; e.getMessage());<br \/>\n        }<br \/>\n    }<br \/>\n}<\/p>\n<p>\u8fd0\u884c\u7ed3\u679c&#xff1a;<\/p>\n<p>\u6355\u83b7\u5f02\u5e38&#xff1a;\u5e74\u9f84\u4e0d\u80fd\u4e3a\u8d1f\u6570&#xff01;\u4f60\u8f93\u5165\u7684\u662f&#xff1a;-10<\/p>\n<p>\u2705 \u6548\u679c&#xff1a;\u901a\u8fc7throw\u4e3b\u52a8\u89e6\u53d1\u5f02\u5e38&#xff0c;\u66ff\u4ee3\u4e86 \u201c\u7a0b\u5e8f\u81ea\u52a8\u89e6\u53d1\u5f02\u5e38\u201d&#xff0c;\u5b9e\u73b0\u4e86\u81ea\u5b9a\u4e49\u5f02\u5e38\u89e6\u53d1\u6761\u4ef6\u3002<\/p>\n<h4 id=\"2.%20throws%20%E2%80%94%E2%80%94%20%E5%A3%B0%E6%98%8E%E6%96%B9%E6%B3%95%E5%8F%AF%E8%83%BD%E6%8A%9B%E5%87%BA%E7%9A%84%E5%BC%82%E5%B8%B8%EF%BC%88%E6%96%B9%E6%B3%95%E5%90%8D%E5%90%8E%E9%9D%A2%E7%94%A8%EF%BC%89\">2. throws \u2014\u2014 \u58f0\u660e\u65b9\u6cd5\u53ef\u80fd\u629b\u51fa\u7684\u5f02\u5e38&#xff08;\u65b9\u6cd5\u540d\u540e\u9762\u7528&#xff09;<\/h4>\n<h5 id=\"%E4%BD%9C%E7%94%A8\">\u4f5c\u7528<\/h5>\n<p>\u544a\u8bc9\u8c03\u7528\u8005 \u201c\u8fd9\u4e2a\u65b9\u6cd5\u5185\u90e8\u53ef\u80fd\u4f1a\u629b\u51fa\u8fd9\u4e9b\u5f02\u5e38&#xff0c;\u6211\u6ca1\u5904\u7406&#xff0c;\u4f60\u81ea\u5df1\u770b\u7740\u529e\u201d&#xff0c;\u5c31\u662f\u4e4b\u524d\u8bb2\u7684 \u201c\u7529\u9505\u201d&#xff0c;\u548cthrow\u662f\u5b8c\u5168\u4e0d\u540c\u7684\u4e1c\u897f&#xff08;\u4e00\u4e2a\u662f\u58f0\u660e&#xff0c;\u4e00\u4e2a\u662f\u6267\u884c&#xff09;\u3002<\/p>\n<h5 id=\"%E7%A4%BA%E4%BE%8B%EF%BC%9A%E6%96%B9%E6%B3%95%E5%86%85%20throw%20%E5%BC%82%E5%B8%B8%EF%BC%8C%E6%96%B9%E6%B3%95%E5%90%8D%E5%90%8E%20throws%20%E5%A3%B0%E6%98%8E\">\u793a\u4f8b&#xff1a;\u65b9\u6cd5\u5185 throw \u5f02\u5e38&#xff0c;\u65b9\u6cd5\u540d\u540e throws \u58f0\u660e<\/h5>\n<p>public class ThrowsTest {<br \/>\n    \/\/ \u65b9\u6cd5\u540d\u540ethrows\u58f0\u660e&#xff1a;\u8be5\u65b9\u6cd5\u53ef\u80fd\u629b\u51faIllegalArgumentException<br \/>\n    public static void checkAge(int age) throws IllegalArgumentException {<br \/>\n        if (age &lt; 0) {<br \/>\n            \/\/ \u65b9\u6cd5\u5185\u90e8throw&#xff0c;\u4e3b\u52a8\u629b\u5f02\u5e38<br \/>\n            throw new IllegalArgumentException(&#034;\u5e74\u9f84\u4e0d\u80fd\u4e3a\u8d1f\u6570&#034;);<br \/>\n        }<br \/>\n        System.out.println(&#034;\u5e74\u9f84\u5408\u6cd5&#xff1a;&#034; &#043; age);<br \/>\n    }<\/p>\n<p>    public static void main(String[] args) {<br \/>\n        try {<br \/>\n            \/\/ \u8c03\u7528\u6709throws\u58f0\u660e\u7684\u65b9\u6cd5&#xff0c;\u8981\u4e48try-catch\u5904\u7406&#xff0c;\u8981\u4e48main\u65b9\u6cd5\u4e5fthrows<br \/>\n            checkAge(-5);<br \/>\n        } catch (IllegalArgumentException e) {<br \/>\n            System.out.println(&#034;\u5904\u7406\u5f02\u5e38&#xff1a;&#034; &#043; e.getMessage());<br \/>\n        }<br \/>\n    }<br \/>\n}<\/p>\n<p>\u8fd0\u884c\u7ed3\u679c&#xff1a;<\/p>\n<p>\u5904\u7406\u5f02\u5e38&#xff1a;\u5e74\u9f84\u4e0d\u80fd\u4e3a\u8d1f\u6570<\/p>\n<h4 id=\"throw%20%E5%92%8C%20throws%20%E6%A0%B8%E5%BF%83%E5%8C%BA%E5%88%AB%EF%BC%88%E4%B8%80%E5%BC%A0%E8%A1%A8%E5%88%86%E6%B8%85%EF%BC%8C%E4%B8%8D%E6%B7%B7%E6%B7%86%EF%BC%89\">throw \u548c throws \u6838\u5fc3\u533a\u522b&#xff08;\u4e00\u5f20\u8868\u5206\u6e05&#xff0c;\u4e0d\u6df7\u6dc6&#xff09;<\/h4>\n<table>\n<tr>\u5173\u952e\u5b57\u4f7f\u7528\u4f4d\u7f6e\u4f5c\u7528\u8bed\u6cd5\u5f62\u5f0f<\/tr>\n<tbody>\n<tr>\n<td>throw<\/td>\n<td>\u65b9\u6cd5\u5185\u90e8<\/td>\n<td>\u4e3b\u52a8 \/ \u624b\u52a8\u629b\u51fa\u4e00\u4e2a\u5f02\u5e38<\/td>\n<td>throw new \u5f02\u5e38\u7c7b\u578b(\u4fe1\u606f);<\/td>\n<\/tr>\n<tr>\n<td>throws<\/td>\n<td>\u65b9\u6cd5\u540d\u540e\u9762<\/td>\n<td>\u58f0\u660e\u65b9\u6cd5\u53ef\u80fd\u629b\u51fa\u591a\u4e2a\u5f02\u5e38<\/td>\n<td>\u65b9\u6cd5\u540d() throws \u5f02\u5e381,\u5f02\u5e382{}<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3 id=\"%E5%85%AD%E3%80%81%E9%9B%B6%E5%9F%BA%E7%A1%80%E5%BC%82%E5%B8%B8%E5%A4%84%E7%90%86%E7%9A%84%205%20%E4%B8%AA%E9%BB%84%E9%87%91%E5%8E%9F%E5%88%99%EF%BC%88%E9%81%BF%E5%9D%91%E5%BF%85%E5%A4%87%EF%BC%8C%E7%9B%B4%E6%8E%A5%E5%A5%97%E7%94%A8%EF%BC%89\">\u516d\u3001\u96f6\u57fa\u7840\u5f02\u5e38\u5904\u7406\u7684 5 \u4e2a\u9ec4\u91d1\u539f\u5219&#xff08;\u907f\u5751\u5fc5\u5907&#xff0c;\u76f4\u63a5\u5957\u7528&#xff09;<\/h3>\n<p>\u5b66\u5b8c\u8bed\u6cd5&#xff0c;\u66f4\u91cd\u8981\u7684\u662f\u517b\u6210\u826f\u597d\u7684\u5f02\u5e38\u5904\u7406\u4e60\u60ef&#xff0c;\u8fd9 5 \u4e2a\u539f\u5219\u90fd\u662f\u5f00\u53d1\u4e2d\u603b\u7ed3\u7684\u5b9e\u6218\u7ecf\u9a8c&#xff0c;\u96f6\u57fa\u7840\u4e25\u683c\u9075\u5b88&#xff0c;\u80fd\u907f\u5f00 90% \u7684\u5f02\u5e38\u5751&#xff01;<\/p>\n<h4 id=\"%E5%8E%9F%E5%88%99%201%EF%BC%9A%E5%B1%80%E9%83%A8%E5%8F%98%E9%87%8F%E5%BF%85%E9%A1%BB%E5%88%9D%E5%A7%8B%E5%8C%96%EF%BC%8C%E9%81%BF%E5%85%8D%20%E2%80%9C%E6%9C%AA%E5%88%9D%E5%A7%8B%E5%8C%96%E2%80%9D%20%E5%AF%BC%E8%87%B4%E7%9A%84%E5%BC%82%E5%B8%B8\">\u539f\u5219 1&#xff1a;\u5c40\u90e8\u53d8\u91cf\u5fc5\u987b\u521d\u59cb\u5316&#xff0c;\u907f\u514d \u201c\u672a\u521d\u59cb\u5316\u201d \u5bfc\u81f4\u7684\u5f02\u5e38<\/h4>\n<p>\u65b9\u6cd5\u5185\u7684\u5c40\u90e8\u53d8\u91cf&#xff08;\u5982int a;&#xff09;\u6ca1\u6709\u9ed8\u8ba4\u503c&#xff0c;\u82e5\u672a\u8d4b\u503c\u5c31\u4f7f\u7528&#xff0c;\u8981\u4e48\u7f16\u8bd1\u62a5\u9519&#xff0c;\u8981\u4e48\u8fd0\u884c\u65f6\u89e6\u53d1\u5f02\u5e38&#xff0c;\u58f0\u660e\u65f6\u76f4\u63a5\u8d4b\u521d\u59cb\u503c&#xff08;\u5982int a &#061; 0; String s &#061; &#034;&#034;;&#xff09;\u3002<\/p>\n<h4 id=\"%E5%8E%9F%E5%88%99%202%EF%BC%9A%E8%B0%83%E7%94%A8%E5%AF%B9%E8%B1%A1%E7%9A%84%E6%96%B9%E6%B3%95%20%2F%20%E5%B1%9E%E6%80%A7%E5%89%8D%EF%BC%8C%E5%85%88%E5%88%A4%E7%A9%BA%EF%BC%88%E9%81%BF%E5%85%8D%E7%A9%BA%E6%8C%87%E9%92%88%EF%BC%89\">\u539f\u5219 2&#xff1a;\u8c03\u7528\u5bf9\u8c61\u7684\u65b9\u6cd5 \/ \u5c5e\u6027\u524d&#xff0c;\u5148\u5224\u7a7a&#xff08;\u907f\u514d\u7a7a\u6307\u9488&#xff09;<\/h4>\n<p>\u7a7a\u6307\u9488&#xff08;NullPointerException&#xff09;\u662f\u5f00\u53d1\u4e2d\u6700\u5e38\u89c1\u7684\u5f02\u5e38&#xff0c;\u53ea\u8981\u8c03\u7528\u5bf9\u8c61\u7684\u65b9\u6cd5 \/ \u5c5e\u6027&#xff08;\u5982s.length()&#xff09;&#xff0c;\u5148\u52a0if (\u5bf9\u8c61 !&#061; null)\u5224\u7a7a&#xff0c;\u518d\u4f7f\u7528\u3002<\/p>\n<h4 id=\"%E5%8E%9F%E5%88%99%203%EF%BC%9A%E8%B5%84%E6%BA%90%E4%BD%BF%E7%94%A8%E5%90%8E%E5%BF%85%E9%A1%BB%E5%85%B3%E9%97%AD%EF%BC%8C%E4%B8%94%E5%85%B3%E9%97%AD%E5%89%8D%E8%A6%81%E5%88%A4%E7%A9%BA\">\u539f\u5219 3&#xff1a;\u8d44\u6e90\u4f7f\u7528\u540e\u5fc5\u987b\u5173\u95ed&#xff0c;\u4e14\u5173\u95ed\u524d\u8981\u5224\u7a7a<\/h4>\n<p>\u4f7f\u7528 Scanner\u3001\u6587\u4ef6\u6d41\u3001\u6570\u636e\u5e93\u8fde\u63a5\u7b49\u8d44\u6e90\u540e&#xff0c;\u4e00\u5b9a\u8981\u5728finally\u5757\u4e2d\u5173\u95ed&#xff0c;\u5173\u95ed\u524d\u5fc5\u987b\u5224\u7a7a&#xff08;if (sc !&#061; null)&#xff09;&#xff0c;\u907f\u514d\u5173\u95ed null \u5bf9\u8c61\u89e6\u53d1\u7a7a\u6307\u9488\u3002<\/p>\n<h4 id=\"%E5%8E%9F%E5%88%99%204%EF%BC%9Acatch%20%E5%9D%97%E8%A6%81%E9%92%88%E5%AF%B9%E6%80%A7%E5%A4%84%E7%90%86%EF%BC%8C%E4%B8%8D%E8%A6%81%E5%8F%AA%E5%86%99%E4%B8%80%E4%B8%AA%20Exception\">\u539f\u5219 4&#xff1a;catch \u5757\u8981\u9488\u5bf9\u6027\u5904\u7406&#xff0c;\u4e0d\u8981\u53ea\u5199\u4e00\u4e2a Exception<\/h4>\n<p>\u867d\u7136Exception\u80fd\u6355\u83b7\u6240\u6709\u5f02\u5e38&#xff0c;\u4f46\u5f00\u53d1\u4e2d\u8981\u5c3d\u91cf\u5199\u5177\u4f53\u7684\u5f02\u5e38\u7c7b\u578b&#xff08;\u5982ArithmeticException\u3001InputMismatchException&#xff09;&#xff0c;\u9488\u5bf9\u6027\u5904\u7406&#xff08;\u6bd4\u5982\u9664\u4ee5 0 \u63d0\u793a \u201c\u4e0d\u80fd\u9664 0\u201d&#xff0c;\u8f93\u5165\u9519\u8bef\u63d0\u793a \u201c\u7c7b\u578b\u4e0d\u5bf9\u201d&#xff09;&#xff0c;\u65b9\u4fbf\u8c03\u8bd5\u548c\u7528\u6237\u7406\u89e3\u3002<\/p>\n<h4 id=\"%E5%8E%9F%E5%88%99%205%EF%BC%9A%E8%BF%90%E8%A1%8C%E6%97%B6%E5%BC%82%E5%B8%B8%E5%B0%BD%E9%87%8F%E5%A4%84%E7%90%86%EF%BC%8C%E7%BC%96%E8%AF%91%E6%97%B6%E5%BC%82%E5%B8%B8%E5%BF%85%E9%A1%BB%E5%A4%84%E7%90%86\">\u539f\u5219 5&#xff1a;\u8fd0\u884c\u65f6\u5f02\u5e38\u5c3d\u91cf\u5904\u7406&#xff0c;\u7f16\u8bd1\u65f6\u5f02\u5e38\u5fc5\u987b\u5904\u7406<\/h4>\n<ul>\n<li>\u8fd0\u884c\u65f6\u5f02\u5e38&#xff08;\u5982\u4e0b\u6807\u8d8a\u754c&#xff09;\u662f\u7a0b\u5e8f\u5458\u7c97\u5fc3\u5bfc\u81f4&#xff0c;\u5c3d\u91cf\u7528try-catch\u5904\u7406&#xff0c;\u907f\u514d\u7a0b\u5e8f\u8fd0\u884c\u65f6\u7a81\u7136\u7ec8\u6b62&#xff1b;<\/li>\n<li>\u7f16\u8bd1\u65f6\u5f02\u5e38&#xff08;\u5982 IOException&#xff09;\u662f Java \u5f3a\u5236\u8981\u6c42&#xff0c;\u8981\u4e48try-catch\u6355\u83b7&#xff0c;\u8981\u4e48throws\u58f0\u660e&#xff0c;\u4e8c\u9009\u4e00&#xff0c;\u4e0d\u5904\u7406\u7f16\u8bd1\u4e0d\u8fc7\u3002<\/li>\n<\/ul>\n<h3 id=\"%E4%B8%83%E3%80%81%E9%9B%B6%E5%9F%BA%E7%A1%80%E5%BF%AB%E9%80%9F%E4%B8%8A%E6%89%8B%E6%80%BB%E7%BB%93%EF%BC%88%E6%A0%B8%E5%BF%83%E7%9F%A5%E8%AF%86%E7%82%B9%E6%B5%93%E7%BC%A9%EF%BC%8C%E4%B8%80%E5%88%86%E9%92%9F%E5%9B%9E%E9%A1%BE%EF%BC%89\">\u4e03\u3001\u96f6\u57fa\u7840\u5feb\u901f\u4e0a\u624b\u603b\u7ed3&#xff08;\u6838\u5fc3\u77e5\u8bc6\u70b9\u6d53\u7f29&#xff0c;\u4e00\u5206\u949f\u56de\u987e&#xff09;<\/h3>\n<li>\u5f02\u5e38\u662f\u4ec0\u4e48&#xff1a;\u7a0b\u5e8f\u8fd0\u884c\u65f6\u7684\u9519\u8bef \/ \u610f\u5916&#xff0c;\u672a\u5904\u7406\u4f1a\u5bfc\u81f4\u7a0b\u5e8f\u7ec8\u6b62&#xff1b;<\/li>\n<li>\u5f02\u5e38\u5206\u4e24\u7c7b&#xff1a;\u8fd0\u884c\u65f6\u5f02\u5e38&#xff08;\u7f16\u8bd1\u4e0d\u5f3a\u5236\u5904\u7406&#xff0c;\u7a0b\u5e8f\u5458\u7c97\u5fc3\u5bfc\u81f4&#xff09;\u3001\u7f16\u8bd1\u65f6\u5f02\u5e38&#xff08;\u7f16\u8bd1\u5fc5\u987b\u5904\u7406&#xff0c;\u5ba2\u89c2\u539f\u56e0\u5bfc\u81f4&#xff09;&#xff1b;<\/li>\n<li>\u6838\u5fc3\u5904\u7406\u8bed\u6cd5&#xff1a;try-catch-finally&#xff0c;try\u653e\u53ef\u80fd\u51fa\u95ee\u9898\u7684\u4ee3\u7801&#xff0c;catch\u5904\u7406\u5f02\u5e38&#xff0c;finally\u505a\u6536\u5c3e&#xff08;\u5173\u95ed\u8d44\u6e90&#xff09;&#xff1b;<\/li>\n<li>\u7f16\u8bd1\u65f6\u5f02\u5e38\u4e8c\u9009\u4e00&#xff1a;\u8981\u4e48try-catch\u6355\u83b7&#xff0c;\u8981\u4e48throws\u58f0\u660e\u7529\u9505&#xff1b;<\/li>\n<li>\u4e24\u4e2a\u8fdb\u9636\u5173\u952e\u5b57&#xff1a;throw&#xff08;\u65b9\u6cd5\u5185\u4e3b\u52a8\u629b\u5f02\u5e38&#xff09;\u3001throws&#xff08;\u65b9\u6cd5\u540e\u58f0\u660e\u53ef\u80fd\u629b\u7684\u5f02\u5e38&#xff09;&#xff1b;<\/li>\n<li>5 \u4e2a\u9ec4\u91d1\u539f\u5219&#xff1a;\u53d8\u91cf\u521d\u59cb\u5316\u3001\u5bf9\u8c61\u5224\u7a7a\u3001\u8d44\u6e90\u5173\u95ed\u3001\u9488\u5bf9\u6027 catch\u3001\u7f16\u8bd1\u65f6\u5f02\u5e38\u5fc5\u5904\u7406\u3002<\/li>\n<p>\u81f3\u6b64&#xff0c;Java \u5f02\u5e38\u7684\u6838\u5fc3\u77e5\u8bc6\u70b9\u5df2\u7ecf\u5168\u90e8\u8bb2\u5b8c&#xff0c;\u96f6\u57fa\u7840\u5c0f\u767d\u6309\u7167\u672c\u6587\u7684\u6a21\u677f\u5957\u4ee3\u7801&#xff0c;\u5c31\u80fd\u8f7b\u677e\u5b9e\u73b0\u5f02\u5e38\u5904\u7406&#xff0c;\u8ba9\u4f60\u7684 Java \u7a0b\u5e8f\u66f4\u5065\u58ee\u3001\u66f4\u4f18\u96c5&#xff01;\u6587\u7ae0\u5982\u6709\u9519\u8bef\u6b22\u8fce\u79c1\u4fe1\u6211&#xff0c;\u6211\u4f1a\u53ca\u65f6\u89e3\u51b3&#xff0c;\u5982\u679c\u6211\u7684\u5185\u5bb9\u5bf9\u4f60\u6709\u5e2e\u52a9\u548c\u542f\u53d1&#xff0c;\u8bf7\u70b9\u8d5e\u3001\u8bc4\u8bba\u3001\u6536\u85cf\u3002\u4f60\u4eec\u7684\u652f\u6301\u5c31\u662f\u6211\u66f4\u65b0\u6700\u5927\u7684\u52a8\u529b&#xff0c;\u90a3\u4e48\u6211\u4eec\u4e0b\u671f\u518d\u89c1&#xff01;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u76ee\u5f55<br \/>\n\u4e00\u3001\u5148\u641e\u61c2&#xff1a;\u5f02\u5e38\u5230\u5e95\u662f\u4ec0\u4e48&#xff1f;&#xff08;\u5927\u767d\u8bdd\u89e3\u91ca&#xff09;<br \/>\n\u4e8c\u3001Java \u5f02\u5e38\u7684\u4e24\u5927\u5206\u7c7b&#xff08;\u6838\u5fc3&#xff01;\u8bb0\u6e05\u8fd9\u4e24\u7c7b\u5c31\u591f\u4e86&#xff09;<br \/>\n1. \u8fd0\u884c\u65f6\u5f02\u5e38&#xff08;\u975e\u68c0\u67e5\u578b\u5f02\u5e38&#xff09;\u2014\u2014 \u6700\u5e38\u89c1&#xff0c;\u53ef\u5904\u7406\u53ef\u4e0d\u5904\u7406<br \/>\n\u6838\u5fc3\u7279\u70b9<br \/>\n\u5e38\u89c1\u4f8b\u5b50&#xff08;\u8bb0\u8fd9 5 \u4e2a&#xff0c;\u8986\u76d6 80% \u5f00\u53d1\u573a\u666f&#xff09;<br \/>\n2. \u7f16\u8bd1\u65f6\u5f02\u5e38&#xff08;\u68c0\u67e5\u578b\u5f02\u5e38&#xff09;<\/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,81,190],"topic":[],"class_list":["post-68258","post","type-post","status-publish","format-standard","hentry","category-server","tag-java","tag-python","tag-190"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>java\u5f02\u5e38\u8be6\u89e3\uff1a\u4e3a0\u57fa\u7840\u5c0f\u767d\u4e13\u95e8\u6253\u9020\uff0c\u5e2e\u52a9\u4f60\u5b66\u4f1a\u5f02\u5e38\u5904\u7406\uff01 - \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\/68258.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"java\u5f02\u5e38\u8be6\u89e3\uff1a\u4e3a0\u57fa\u7840\u5c0f\u767d\u4e13\u95e8\u6253\u9020\uff0c\u5e2e\u52a9\u4f60\u5b66\u4f1a\u5f02\u5e38\u5904\u7406\uff01 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u76ee\u5f55 \u4e00\u3001\u5148\u641e\u61c2&#xff1a;\u5f02\u5e38\u5230\u5e95\u662f\u4ec0\u4e48&#xff1f;&#xff08;\u5927\u767d\u8bdd\u89e3\u91ca&#xff09; \u4e8c\u3001Java \u5f02\u5e38\u7684\u4e24\u5927\u5206\u7c7b&#xff08;\u6838\u5fc3&#xff01;\u8bb0\u6e05\u8fd9\u4e24\u7c7b\u5c31\u591f\u4e86&#xff09; 1. \u8fd0\u884c\u65f6\u5f02\u5e38&#xff08;\u975e\u68c0\u67e5\u578b\u5f02\u5e38&#xff09;\u2014\u2014 \u6700\u5e38\u89c1&#xff0c;\u53ef\u5904\u7406\u53ef\u4e0d\u5904\u7406 \u6838\u5fc3\u7279\u70b9 \u5e38\u89c1\u4f8b\u5b50&#xff08;\u8bb0\u8fd9 5 \u4e2a&#xff0c;\u8986\u76d6 80% \u5f00\u53d1\u573a\u666f&#xff09; 2. \u7f16\u8bd1\u65f6\u5f02\u5e38&#xff08;\u68c0\u67e5\u578b\u5f02\u5e38&#xff09;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/68258.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-01-29T15:49:16+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=\"7 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/68258.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/68258.html\",\"name\":\"java\u5f02\u5e38\u8be6\u89e3\uff1a\u4e3a0\u57fa\u7840\u5c0f\u767d\u4e13\u95e8\u6253\u9020\uff0c\u5e2e\u52a9\u4f60\u5b66\u4f1a\u5f02\u5e38\u5904\u7406\uff01 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-01-29T15:49:16+00:00\",\"dateModified\":\"2026-01-29T15:49:16+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/68258.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/68258.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/68258.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"java\u5f02\u5e38\u8be6\u89e3\uff1a\u4e3a0\u57fa\u7840\u5c0f\u767d\u4e13\u95e8\u6253\u9020\uff0c\u5e2e\u52a9\u4f60\u5b66\u4f1a\u5f02\u5e38\u5904\u7406\uff01\"}]},{\"@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\u5f02\u5e38\u8be6\u89e3\uff1a\u4e3a0\u57fa\u7840\u5c0f\u767d\u4e13\u95e8\u6253\u9020\uff0c\u5e2e\u52a9\u4f60\u5b66\u4f1a\u5f02\u5e38\u5904\u7406\uff01 - \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\/68258.html","og_locale":"zh_CN","og_type":"article","og_title":"java\u5f02\u5e38\u8be6\u89e3\uff1a\u4e3a0\u57fa\u7840\u5c0f\u767d\u4e13\u95e8\u6253\u9020\uff0c\u5e2e\u52a9\u4f60\u5b66\u4f1a\u5f02\u5e38\u5904\u7406\uff01 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u76ee\u5f55 \u4e00\u3001\u5148\u641e\u61c2&#xff1a;\u5f02\u5e38\u5230\u5e95\u662f\u4ec0\u4e48&#xff1f;&#xff08;\u5927\u767d\u8bdd\u89e3\u91ca&#xff09; \u4e8c\u3001Java \u5f02\u5e38\u7684\u4e24\u5927\u5206\u7c7b&#xff08;\u6838\u5fc3&#xff01;\u8bb0\u6e05\u8fd9\u4e24\u7c7b\u5c31\u591f\u4e86&#xff09; 1. \u8fd0\u884c\u65f6\u5f02\u5e38&#xff08;\u975e\u68c0\u67e5\u578b\u5f02\u5e38&#xff09;\u2014\u2014 \u6700\u5e38\u89c1&#xff0c;\u53ef\u5904\u7406\u53ef\u4e0d\u5904\u7406 \u6838\u5fc3\u7279\u70b9 \u5e38\u89c1\u4f8b\u5b50&#xff08;\u8bb0\u8fd9 5 \u4e2a&#xff0c;\u8986\u76d6 80% \u5f00\u53d1\u573a\u666f&#xff09; 2. \u7f16\u8bd1\u65f6\u5f02\u5e38&#xff08;\u68c0\u67e5\u578b\u5f02\u5e38&#xff09;","og_url":"https:\/\/www.wsisp.com\/helps\/68258.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-01-29T15:49:16+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"7 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/68258.html","url":"https:\/\/www.wsisp.com\/helps\/68258.html","name":"java\u5f02\u5e38\u8be6\u89e3\uff1a\u4e3a0\u57fa\u7840\u5c0f\u767d\u4e13\u95e8\u6253\u9020\uff0c\u5e2e\u52a9\u4f60\u5b66\u4f1a\u5f02\u5e38\u5904\u7406\uff01 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-01-29T15:49:16+00:00","dateModified":"2026-01-29T15:49:16+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/68258.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/68258.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/68258.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"java\u5f02\u5e38\u8be6\u89e3\uff1a\u4e3a0\u57fa\u7840\u5c0f\u767d\u4e13\u95e8\u6253\u9020\uff0c\u5e2e\u52a9\u4f60\u5b66\u4f1a\u5f02\u5e38\u5904\u7406\uff01"}]},{"@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\/68258","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=68258"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/68258\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=68258"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=68258"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=68258"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=68258"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}