{"id":1343,"date":"2025-02-25T15:58:57","date_gmt":"2025-02-25T07:58:57","guid":{"rendered":"https:\/\/www.tqazy.com\/?p=1343"},"modified":"2025-02-25T16:17:25","modified_gmt":"2025-02-25T08:17:25","slug":"%e9%9d%a2%e8%af%95%e7%ac%94%e8%ae%b003-java%e5%9f%ba%e7%a1%80%ef%bc%88%e4%b8%89%ef%bc%89%ef%bc%9a%e5%bc%82%e5%b8%b8%e5%a4%84%e7%90%86","status":"publish","type":"post","link":"https:\/\/www.tqazy.com\/?p=1343","title":{"rendered":"\u9762\u8bd5\u7b14\u8bb003-Java\u57fa\u7840\uff08\u4e09\uff09\uff1a\u5f02\u5e38\u5904\u7406"},"content":{"rendered":"<h1>\u4e00\u3001\u5f02\u5e38\u7684\u6982\u5ff5<\/h1>\n<p>Java\u8bed\u8a00\u4e2d\uff0c<strong>\u5f02\u5e38<\/strong>\u662f\u7a0b\u5e8f\u8fd0\u884c\u65f6\u51fa\u73b0\u7684\u4e0d\u6b63\u5e38\u6216\u610f\u5916\u60c5\u51b5\u3002<\/p>\n<div style=\"height:1.5em\"><\/div>\n<h1>\u4e8c\u3001\u5f02\u5e38\u7684\u5206\u7c7b<\/h1>\n<p><strong>1. \u5f02\u5e38\u7684\u5206\u7c7b<\/strong><br \/>\n<strong>\u7b54\uff1a<\/strong><br \/>\nJava\u5f02\u5e38\u90fd\u7ee7\u627f\u81ea <code>Throwable<\/code>\uff0c\u4e3b\u8981\u5206\u4e24\u7c7b\uff1a<\/p>\n<ul>\n<li><strong>Error<\/strong>\uff1a\u7cfb\u7edf\u4e25\u91cd\u9519\u8bef\uff0c\u5982<code>OutOfMemoryError<\/code>\uff08\u5806\u5185\u5b58\u6ea2\u51fa\u9519\u8bef\uff09\uff0c\u7a0b\u5e8f\u65e0\u6cd5\u5904\u7406\u3002<\/li>\n<li><strong>Exception<\/strong>\uff1a\u7a0b\u5e8f\u53ef\u5904\u7406\u5f02\u5e38\uff0c\u53c8\u5206\u4e3a\uff1a\n<ul>\n<li><strong>\u53d7\u68c0\u5f02\u5e38<\/strong>\uff1a\u7f16\u8bd1\u65f6\u9700\u5904\u7406\uff0c\u5982<code>IOException<\/code>\uff08\u8f93\u5165\u8f93\u51fa\u5f02\u5e38\uff09\u3002<\/li>\n<li><strong>\u975e\u53d7\u68c0\u5f02\u5e38<\/strong>\uff1a\u7f16\u8bd1\u65f6\u4e0d\u5f3a\u5236\u5904\u7406\uff0c\u5982<code>NullPointerException<\/code>\uff08\u7a7a\u6307\u9488\u5f02\u5e38\uff09\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<div style=\"height:1.5em\"><\/div>\n<p><strong>2. \u53d7\u68c0\u5f02\u5e38\u548c\u975e\u53d7\u68c0\u5f02\u5e38\u5728\u4f7f\u7528\u4e0a\u6709\u4ec0\u4e48\u533a\u522b\uff1f<\/strong><br \/>\n<strong>\u7b54\uff1a<\/strong><\/p>\n<ul>\n<li>\u53d7\u68c0\u5f02\u5e38\u7ee7\u627f\u81ea <code>Exception<\/code>\u3002\u4f7f\u7528\u65f6\uff1a\n<ul>\n<li>\u8981\u4e48\u5728\u65b9\u6cd5\u5185\u90e8\u4f7f\u7528 <code>try-catch<\/code> \u6355\u83b7\u5904\u7406\uff0c<\/li>\n<li>\u8981\u4e48\u5728\u65b9\u6cd5\u58f0\u660e\u5904\u4f7f\u7528 <code>throws<\/code> \u5173\u952e\u5b57\u629b\u51fa\uff0c\u5426\u5219\u7f16\u8bd1\u4e0d\u901a\u8fc7\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\u975e\u53d7\u68c0\u5f02\u5e38\u7ee7\u627f\u81ea <code>RuntimeException<\/code>\u3002\u4f7f\u7528\u65f6\uff1a\n<ul>\n<li>\u4e0d\u9700\u8981\u5728\u65b9\u6cd5\u58f0\u660e\u4e2d\u663e\u5f0f\u629b\u51fa\uff0c<\/li>\n<li>\u4e5f\u4e0d\u5f3a\u5236\u8981\u6c42\u5728\u65b9\u6cd5\u5185\u90e8\u6355\u83b7\uff0c\u7f16\u8bd1\u80fd\u6b63\u5e38\u901a\u8fc7\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<div style=\"height:1.5em\"><\/div>\n<p><strong>3. \u5e38\u89c1\u7684Error\u3001\u53d7\u68c0\u5f02\u5e38\u3001\u975e\u53d7\u68c0\u5f02\u5e38\u6709\u54ea\u4e9b\uff1f<\/strong><br \/>\n<strong>\u7b54\uff1a<\/strong><br \/>\n<strong>\u5e38\u89c1 Error<\/strong><\/p>\n<ul>\n<li><code>StackOverflowError<\/code>\uff1a\u6808\u6ea2\u51fa\u9519\u8bef<\/li>\n<li><code>OutOfMemoryError<\/code>\uff1a\u5185\u5b58\u6ea2\u51fa\u9519\u8bef<\/li>\n<li><code>NoClassDefFoundError<\/code>\uff1a\u7c7b\u5b9a\u4e49\u672a\u627e\u5230\u9519\u8bef<\/li>\n<li><code>LinkageError<\/code>\uff1a\u94fe\u63a5\u9519\u8bef<\/li>\n<\/ul>\n<p><strong>\u5e38\u89c1\u53d7\u68c0\u5f02\u5e38<\/strong><\/p>\n<ul>\n<li><code>IOException<\/code>\uff1a\u8f93\u5165\u8f93\u51fa\u5f02\u5e38<\/li>\n<li><code>SQLException<\/code>\uff1a\u6570\u636e\u5e93\u64cd\u4f5c\u5f02\u5e38<\/li>\n<li><code>ClassNotFoundException<\/code>\uff1a\u7c7b\u672a\u627e\u5230\u5f02\u5e38<\/li>\n<li><code>InterruptedException<\/code>\uff1a\u7ebf\u7a0b\u4e2d\u65ad\u5f02\u5e38<\/li>\n<\/ul>\n<p><strong>\u5e38\u89c1\u975e\u53d7\u68c0\u5f02\u5e38<\/strong><\/p>\n<ul>\n<li><code>NullPointerException<\/code>\uff1a\u7a7a\u6307\u9488\u5f02\u5e38<\/li>\n<li><code>ArrayIndexOutOfBoundsException<\/code>\uff1a\u6570\u7ec4\u8d8a\u754c\u5f02\u5e38<\/li>\n<li><code>ArithmeticException<\/code>\uff1a\u7b97\u672f\u5f02\u5e38<\/li>\n<li><code>NumberFormatException<\/code>\uff1a\u6570\u5b57\u683c\u5f0f\u5f02\u5e38<\/li>\n<li><code>IllegalArgumentException<\/code>\uff1a\u975e\u6cd5\u53c2\u6570\u5f02\u5e38<\/li>\n<li><code>IndexOutOfBoundsException<\/code>\uff1a\u7d22\u5f15\u8d8a\u754c\u5f02\u5e38<\/li>\n<\/ul>\n<div style=\"height:1.5em\"><\/div>\n<p><strong>4. \u5206\u522b\u7ed9\u51fa\u4e00\u4e2aError\u3001\u53d7\u68c0\u5f02\u5e38\u3001\u975e\u53d7\u68c0\u5f02\u5e38\u7684\u7b80\u5355\u793a\u4f8b\u4ee3\u7801\u3002<\/strong><br \/>\n<strong>\u7b54\uff1a<\/strong><br \/>\n<strong>(1) Error \u793a\u4f8b<\/strong><br \/>\n<code>StackOverflowError<\/code> \u5c5e\u4e8e <code>Error<\/code> \u7c7b\u578b\uff0c\u901a\u5e38\u5728\u65b9\u6cd5\u65e0\u9650\u9012\u5f52\u8c03\u7528\u65f6\u4ea7\u751f\uff0c\u56e0\u4e3a\u6bcf\u6b21\u65b9\u6cd5\u8c03\u7528\u90fd\u4f1a\u5728\u6808\u4e0a\u5206\u914d\u7a7a\u95f4\uff0c\u65e0\u9650\u9012\u5f52\u4f1a\u4f7f\u6808\u7a7a\u95f4\u8017\u5c3d\u3002<\/p>\n<pre><code class=\"language-java\">\/\/ \u6d4b\u8bd5\u7c7b\npublic class StackOverflowErrorExample {\n    public static void recursiveMethod() {\n        \/\/ \u65e0\u9650\u9012\u5f52\u8c03\u7528\u81ea\u8eab\n        recursiveMethod();\n    }\n\n    public static void main(String[] args) {\n        try {\n            recursiveMethod();\n        } catch (StackOverflowError e) {\n            System.out.println(&quot;\u6355\u83b7\u5230 StackOverflowError: &quot; + e);\n        }\n    }\n}<\/code><\/pre>\n<p>\u6d4b\u8bd5\u7ed3\u679c\uff1a<\/p>\n<blockquote>\n<p>\u6355\u83b7\u5230 StackOverflowError: java.lang.StackOverflowError<\/p>\n<\/blockquote>\n<p><strong>\u89e3\u91ca\uff1a<\/strong><br \/>\n\u5728 <code>recursiveMethod<\/code> \u65b9\u6cd5\u4e2d\uff0c\u5b83\u4e0d\u65ad\u5730\u8c03\u7528\u81ea\u8eab\uff0c\u6ca1\u6709\u7ec8\u6b62\u6761\u4ef6\uff0c\u6700\u7ec8\u4f1a\u5bfc\u81f4\u6808\u7a7a\u95f4\u8017\u5c3d\uff0c\u629b\u51fa <code>StackOverflowError<\/code>\u3002\u5728 <code>main<\/code> \u65b9\u6cd5\u91cc\uff0c\u4f7f\u7528 <code>try-catch<\/code> \u5757\u6355\u83b7\u8be5\u9519\u8bef\u5e76\u8f93\u51fa\u9519\u8bef\u4fe1\u606f\u3002<\/p>\n<div style=\"height:1.5em\"><\/div>\n<p><strong>(2) \u53d7\u68c0\u5f02\u5e38\u793a\u4f8b<\/strong><br \/>\n<code>IOException<\/code> \u662f\u5178\u578b\u7684\u53d7\u68c0\u5f02\u5e38\uff0c\u5728\u8fdb\u884c\u6587\u4ef6\u64cd\u4f5c\u3001\u7f51\u7edc\u64cd\u4f5c\u7b49\u53ef\u80fd\u53d1\u751f\u8f93\u5165\u8f93\u51fa\u95ee\u9898\u7684\u573a\u666f\u4e2d\u7ecf\u5e38\u51fa\u73b0\uff0c\u4f7f\u7528\u65f6\u5fc5\u987b\u8fdb\u884c\u5904\u7406\u3002<\/p>\n<pre><code class=\"language-java\">import java.io.FileReader;\nimport java.io.IOException;\n\npublic class IOExceptionExample {\n    public static void readFile() throws IOException {\n        \/\/ \u5c1d\u8bd5\u6253\u5f00\u4e00\u4e2a\u6587\u4ef6\u8fdb\u884c\u8bfb\u53d6\n        FileReader reader = new FileReader(&quot;nonexistentfile.txt&quot;);\n        int data;\n        while ((data = reader.read()) != -1) {\n            System.out.print((char) data);\n        }\n        reader.close();\n    }\n\n    public static void main(String[] args) {\n        try {\n            readFile();\n        } catch (IOException e) {\n            System.out.println(&quot;\u6355\u83b7\u5230 IOException: &quot; + e.getMessage());\n        }\n    }\n}<\/code><\/pre>\n<p>\u6d4b\u8bd5\u7ed3\u679c\uff1a<\/p>\n<blockquote>\n<p>\u6355\u83b7\u5230 IOException: nonexistentfile.txt (\u7cfb\u7edf\u627e\u4e0d\u5230\u6307\u5b9a\u7684\u6587\u4ef6\u3002)<\/p>\n<\/blockquote>\n<p><strong>\u89e3\u91ca\uff1a<\/strong><br \/>\n<code>readFile<\/code> \u65b9\u6cd5\u5c1d\u8bd5\u6253\u5f00\u4e00\u4e2a\u4e0d\u5b58\u5728\u7684\u6587\u4ef6 <code>nonexistentfile.txt<\/code> \u8fdb\u884c\u8bfb\u53d6\uff0c\u8fd9\u4f1a\u5f15\u53d1 <code>IOException<\/code>\u3002<br \/>\n\u7531\u4e8e <code>IOException<\/code> \u662f\u53d7\u68c0\u5f02\u5e38\uff0c<code>readFile<\/code> \u65b9\u6cd5\u4f7f\u7528 <code>throws<\/code> \u5173\u952e\u5b57\u58f0\u660e\u629b\u51fa\u8be5\u5f02\u5e38\u3002<br \/>\n\u5728 <code>main<\/code> \u65b9\u6cd5\u4e2d\uff0c\u8c03\u7528 <code>readFile<\/code> \u65b9\u6cd5\u5e76\u4f7f\u7528 <code>try-catch<\/code> \u5757\u6355\u83b7\u5e76\u5904\u7406\u8be5\u5f02\u5e38\u3002<\/p>\n<div style=\"height:1.5em\"><\/div>\n<p><strong>(3) \u975e\u53d7\u68c0\u5f02\u5e38\u793a\u4f8b<\/strong><br \/>\n<code>NullPointerException<\/code> \u5c5e\u4e8e\u975e\u53d7\u68c0\u5f02\u5e38\uff0c\u901a\u5e38\u5728\u5c1d\u8bd5\u5bf9\u4e00\u4e2a <code>null<\/code> \u5bf9\u8c61\u8fdb\u884c\u64cd\u4f5c\u65f6\u629b\u51fa\u3002<\/p>\n<pre><code class=\"language-java\">public class NullPointerExceptionExample {\n    public static void main(String[] args) {\n        String str = null;\n        try {\n            \/\/ \u5bf9 null \u5bf9\u8c61\u8c03\u7528\u65b9\u6cd5\uff0c\u4f1a\u629b\u51fa NullPointerException\n            int length = str.length();\n            System.out.println(&quot;\u5b57\u7b26\u4e32\u957f\u5ea6: &quot; + length);\n        } catch (NullPointerException e) {\n            System.out.println(&quot;\u6355\u83b7\u5230 NullPointerException: &quot; + e);\n        }\n    }\n}<\/code><\/pre>\n<p>\u6d4b\u8bd5\u7ed3\u679c\uff1a<\/p>\n<blockquote>\n<p>\u6355\u83b7\u5230 NullPointerException: java.lang.NullPointerException<\/p>\n<\/blockquote>\n<p><strong>\u89e3\u91ca\uff1a<\/strong><br \/>\n\u5728 <code>main<\/code> \u65b9\u6cd5\u4e2d\uff0c\u5b9a\u4e49\u4e86\u4e00\u4e2a <code>null<\/code> \u7684\u5b57\u7b26\u4e32\u5bf9\u8c61 <code>str<\/code>\uff0c\u7136\u540e\u5c1d\u8bd5\u8c03\u7528\u5b83\u7684 <code>length()<\/code> \u65b9\u6cd5\uff0c\u8fd9\u4f1a\u5bfc\u81f4 <code>NullPointerException<\/code> \u5f02\u5e38\u3002\u4f7f\u7528 <code>try-catch<\/code> \u5757\u6355\u83b7\u5e76\u5904\u7406\u8be5\u5f02\u5e38\u3002<\/p>\n<div style=\"height:1.5em\"><\/div>\n<h1>\u4e09\u3001<code>try-catch-finally<\/code> \u8bed\u53e5<\/h1>\n<p><strong>1. \u7b80\u8ff0 <code>try-catch-finally<\/code> \u8bed\u53e5\u5757\u4e2d\u5404\u90e8\u5206\u7684\u4f5c\u7528<\/strong><br \/>\n<strong>\u7b54\uff1a<\/strong><\/p>\n<ul>\n<li><code>try<\/code> \u5757\u5305\u542b\u53ef\u80fd\u629b\u51fa\u5f02\u5e38\u7684\u4ee3\u7801\uff1b<\/li>\n<li><code>catch<\/code> \u5757\u7528\u4e8e\u6355\u83b7\u5e76\u5904\u7406 <code>try<\/code> \u5757\u4e2d\u629b\u51fa\u7684\u6307\u5b9a\u7c7b\u578b\u5f02\u5e38\uff1b<\/li>\n<li><code>finally<\/code> \u5757\u65e0\u8bba\u662f\u5426\u53d1\u751f\u5f02\u5e38\u90fd\u4f1a\u6267\u884c\uff0c\u5e38\u7528\u4e8e\u91ca\u653e\u8d44\u6e90\u3002<\/li>\n<\/ul>\n<div style=\"height:1.5em\"><\/div>\n<p><strong>2. \u5728 <code>try-catch-finally<\/code> \u7ed3\u6784\u4e2d\uff0c\u5982\u679c <code>try<\/code> \u5757\u4e2d\u6709 <code>return<\/code> \u8bed\u53e5\uff0c<code>finally<\/code> \u5757\u4e2d\u7684\u4ee3\u7801\u4f1a\u6267\u884c\u5417\uff1f<\/strong><br \/>\n<strong>\u7b54\uff1a<\/strong><br \/>\n\u4f1a\u6267\u884c\u3002<br \/>\n\u5728 <code>try<\/code> \u5757\u9047\u5230 <code>return<\/code> \u8bed\u53e5\u65f6\uff0c\u4f1a\u5148\u4fdd\u5b58\u8fd4\u56de\u503c\uff0c\u7136\u540e\u6267\u884c <code>finally<\/code> \u5757\u4e2d\u7684\u4ee3\u7801\uff0c\u6700\u540e\u518d\u8fd4\u56de\u4e4b\u524d\u4fdd\u5b58\u7684\u503c\u3002<\/p>\n<div style=\"height:1.5em\"><\/div>\n<p><strong>3. <code>catch<\/code> \u5757\u6355\u83b7\u5f02\u5e38\u540e\uff0c\u82e5 <code>finally<\/code> \u5757\u4e2d\u6709 <code>return<\/code> \u8bed\u53e5\uff0c\u4f1a\u5bf9 <code>try<\/code> \u6216 <code>catch<\/code> \u5757\u4e2d\u7684 <code>return<\/code> \u7ed3\u679c\u6709\u4ec0\u4e48\u5f71\u54cd\uff1f<\/strong><br \/>\n<strong>\u7b54\uff1a<\/strong><br \/>\n\u82e5 <code>finally<\/code> \u5757\u4e2d\u6709 <code>return<\/code> \u8bed\u53e5\uff0c\u4f1a\u8986\u76d6 <code>try<\/code> \u6216 <code>catch<\/code> \u5757\u4e2d\u7684 <code>return<\/code> \u7ed3\u679c\uff0c\u6700\u7ec8\u8fd4\u56de <code>finally<\/code> \u5757\u4e2d <code>return<\/code> \u7684\u503c\u3002<\/p>\n<div style=\"height:1.5em\"><\/div>\n<p><strong>4. \u8bf7\u7ed9\u51fa\u4e00\u4e2a\u7ecf\u5178\u4e14\u7b80\u6d01\u7684try-catch-finally \u8bed\u53e5\u7684\u4f7f\u7528\u573a\u666f<\/strong><br \/>\n<strong>\u7b54\uff1a<\/strong><\/p>\n<pre><code class=\"language-java\">import java.io.BufferedReader;\nimport java.io.FileReader;\nimport java.io.IOException;\n\npublic class TryCatchFinallyExample {\n    public static void main(String[] args) {\n        BufferedReader reader = null;\n        try {\n            \/\/ \u5c1d\u8bd5\u6253\u5f00\u6587\u4ef6\u8fdb\u884c\u8bfb\u53d6\n            reader = new BufferedReader(new FileReader(&quot;test.txt&quot;));\n            String line;\n            \/\/ \u9010\u884c\u8bfb\u53d6\u6587\u4ef6\u5185\u5bb9\u5e76\u8f93\u51fa\n            while ((line = reader.readLine()) != null) {\n                System.out.println(line);\n            }\n        } catch (IOException e) {\n            \/\/ \u6355\u83b7\u5e76\u5904\u7406\u53ef\u80fd\u51fa\u73b0\u7684\u8f93\u5165\u8f93\u51fa\u5f02\u5e38\n            System.err.println(&quot;\u8bfb\u53d6\u6587\u4ef6\u65f6\u51fa\u73b0\u9519\u8bef: &quot; + e.getMessage());\n        } finally {\n            try {\n                if (reader != null) {\n                    \/\/ \u786e\u4fdd\u6587\u4ef6\u8bfb\u53d6\u5668\u88ab\u5173\u95ed\n                    reader.close();\n                }\n            } catch (IOException e) {\n                \/\/ \u5904\u7406\u5173\u95ed\u6587\u4ef6\u8bfb\u53d6\u5668\u65f6\u53ef\u80fd\u51fa\u73b0\u7684\u5f02\u5e38\n                System.err.println(&quot;\u5173\u95ed\u6587\u4ef6\u8bfb\u53d6\u5668\u65f6\u51fa\u73b0\u9519\u8bef: &quot; + e.getMessage());\n            }\n        }\n    }\n}<\/code><\/pre>\n<p><strong>\u4ee3\u7801\u89e3\u91ca<\/strong><\/p>\n<ul>\n<li><strong><code>try<\/code> \u5757\uff1a<\/strong> \u4ee3\u7801\u5c1d\u8bd5\u6253\u5f00\u5e76\u8bfb\u53d6\u6587\u4ef6 <code>test.txt<\/code> \u7684\u5185\u5bb9\uff0c\u5c06\u6587\u4ef6\u5185\u5bb9\u9010\u884c\u8f93\u51fa\u3002\u7531\u4e8e\u6587\u4ef6\u64cd\u4f5c\u53ef\u80fd\u4f1a\u51fa\u73b0\u5f02\u5e38\uff0c\u5982\u6587\u4ef6\u4e0d\u5b58\u5728\u3001\u6587\u4ef6\u65e0\u6cd5\u8bbf\u95ee\u7b49\uff0c\u6240\u4ee5\u8fd9\u4e9b\u64cd\u4f5c\u88ab\u653e\u5728 <code>try<\/code> \u5757\u4e2d\u3002<\/li>\n<li><strong><code>catch<\/code> \u5757\uff1a<\/strong> \u5f53 <code>try<\/code> \u5757\u4e2d\u7684\u4ee3\u7801\u629b\u51fa <code>IOException<\/code> \u65f6\uff0c<code>catch<\/code> \u5757\u4f1a\u6355\u83b7\u8be5\u5f02\u5e38\uff0c\u5e76\u5c06\u9519\u8bef\u4fe1\u606f\u6253\u5370\u5230\u6807\u51c6\u9519\u8bef\u8f93\u51fa\u3002<\/li>\n<li><strong><code>finally<\/code> \u5757\uff1a<\/strong> \u65e0\u8bba <code>try<\/code> \u5757\u4e2d\u662f\u5426\u53d1\u751f\u5f02\u5e38\uff0c<code>finally<\/code> \u5757\u4e2d\u7684\u4ee3\u7801\u90fd\u4f1a\u6267\u884c\u3002\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c<code>finally<\/code> \u5757\u7528\u4e8e\u5173\u95ed\u6587\u4ef6\u8bfb\u53d6\u5668 <code>BufferedReader<\/code>\uff0c\u4ee5\u786e\u4fdd\u8d44\u6e90\u88ab\u6b63\u786e\u91ca\u653e\u3002\u5173\u95ed\u64cd\u4f5c\u4e5f\u53ef\u80fd\u4f1a\u629b\u51fa <code>IOException<\/code>\uff0c\u56e0\u6b64\u540c\u6837\u4f7f\u7528 <code>try-catch<\/code> \u8bed\u53e5\u6765\u5904\u7406\u3002<\/li>\n<\/ul>\n<div style=\"height:1.5em\"><\/div>\n<h1>\u56db\u3001\u81ea\u5b9a\u4e49\u5f02\u5e38<\/h1>\n<p><strong>1. \u4e3a\u4ec0\u4e48\u9700\u8981\u81ea\u5b9a\u4e49\u5f02\u5e38\uff1f<\/strong><br \/>\n<strong>\u7b54\uff1a<\/strong><br \/>\n\u5728\u5b9e\u9645\u5f00\u53d1\u4e2d\uff0cJava\u5185\u7f6e\u7684\u5f02\u5e38\u7c7b\u578b\u53ef\u80fd\u65e0\u6cd5\u7cbe\u51c6\u63cf\u8ff0\u4e1a\u52a1\u573a\u666f\u4e2d\u51fa\u73b0\u7684\u95ee\u9898\u3002<br \/>\n\u81ea\u5b9a\u4e49\u5f02\u5e38\u80fd\u4f7f\u5f02\u5e38\u4fe1\u606f\u66f4\u5177\u9488\u5bf9\u6027\uff0c\u4fbf\u4e8e\u4ee3\u7801\u7684\u7ef4\u62a4\u548c\u8c03\u8bd5\uff0c\u8ba9\u5f00\u53d1\u8005\u53ef\u4ee5\u6839\u636e\u4e1a\u52a1\u9700\u6c42\u5bf9\u7279\u5b9a\u60c5\u51b5\u8fdb\u884c\u5f02\u5e38\u5904\u7406\u3002<\/p>\n<div style=\"height:1.5em\"><\/div>\n<p><strong>2. \u7b80\u8ff0\u81ea\u5b9a\u4e49\u5f02\u5e38\u7684\u6b65\u9aa4\u3002<\/strong><br \/>\n<strong>\u7b54\uff1a<\/strong><br \/>\n(1) \u521b\u5efa\u4e00\u4e2a\u7c7b\u7ee7\u627f\u81ea <code>Exception<\/code>\uff08\u53d7\u68c0\u5f02\u5e38\uff09\u6216 <code>RuntimeException<\/code>\uff08\u975e\u53d7\u68c0\u5f02\u5e38\uff09\u3002<br \/>\n(2) \u63d0\u4f9b\u81f3\u5c11\u4e00\u4e2a\u6784\u9020\u65b9\u6cd5\uff0c\u901a\u5e38\u5305\u542b\u4e00\u4e2a\u63a5\u6536\u5f02\u5e38\u4fe1\u606f\u5b57\u7b26\u4e32\u7684\u6784\u9020\u65b9\u6cd5\u3002<br \/>\n(3) \u82e5\u6709\u9700\u8981\uff0c\u53ef\u6dfb\u52a0\u5176\u4ed6\u81ea\u5b9a\u4e49\u65b9\u6cd5\u3002<\/p>\n<div style=\"height:1.5em\"><\/div>\n<p><strong>3. \u7ed9\u51fa\u4e00\u4e2a\u7ecf\u5178\u7684\u81ea\u5b9a\u4e49\u5f02\u5e38\u7684\u7b80\u5355\u793a\u4f8b\u4ee3\u7801<\/strong><br \/>\n<strong>\u7b54\uff1a<\/strong><br \/>\n\u4ee5\u4e0b\u662f\u4e00\u4e2a\u81ea\u5b9a\u4e49\u5f02\u5e38\u793a\u4f8b\uff0c\u6a21\u62df\u5728\u4e00\u4e2a\u7b80\u5355\u7684\u94f6\u884c\u8d26\u6237\u7cfb\u7edf\u4e2d\uff0c\u5f53\u5c1d\u8bd5\u53d6\u6b3e\u91d1\u989d\u8d85\u8fc7\u8d26\u6237\u4f59\u989d\u65f6\u629b\u51fa\u5f02\u5e38\u3002(\u65e5\u5e38\u6211\u4eec\u5224\u5b9a\u4f59\u989d\u4e0d\u8db3\u5e76\u4e0d\u4f1a\u4f7f\u7528\u5f02\u5e38\u629b\u51fa\uff0c\u8fd9\u91cc\u53ea\u662f\u4f5c\u793a\u4f8b\u3002)<br \/>\n<strong>\u81ea\u5b9a\u4e49\u5f02\u5e38\u7c7b<\/strong><\/p>\n<pre><code class=\"language-java\">\/\/ \u81ea\u5b9a\u4e49\u5f02\u5e38\u7c7b\uff08\u4f59\u989d\u4e0d\u8db3\u5f02\u5e38\uff09\uff0c\u7ee7\u627f\u81ea Exception\uff0c\u5c5e\u4e8e\u53d7\u68c0\u5f02\u5e38\nclass InsufficientBalanceException extends Exception {\n    \/\/ \u6784\u9020\u65b9\u6cd5\uff0c\u63a5\u6536\u5f02\u5e38\u4fe1\u606f\n    public InsufficientBalanceException(String message) {\n        super(message);\n    }\n}<\/code><\/pre>\n<p><strong>\u94f6\u884c\u8d26\u6237\u7c7b<\/strong><\/p>\n<pre><code class=\"language-java\">\/\/ \u94f6\u884c\u8d26\u6237\u7c7b\nclass BankAccount {\n    \/\/ \u6210\u5458\u53d8\u91cf\uff1a\u8d26\u6237\u4f59\u989d\n    private double balance;\n\n    \/\/ \u6784\u9020\u65b9\u6cd5\uff0c\u521d\u59cb\u5316\u8d26\u6237\u4f59\u989d\n    public BankAccount(double initialBalance) {\n        this.balance = initialBalance;\n    }\n\n    \/\/ \u53d6\u6b3e\u65b9\u6cd5\uff0c\u53ef\u80fd\u629b\u51fa InsufficientBalanceException \u5f02\u5e38\n    public void withdraw(double amount) throws InsufficientBalanceException {\n        if (amount &gt; balance) {\n            \/\/ \u5f53\u53d6\u6b3e\u91d1\u989d\u5927\u4e8e\u8d26\u6237\u4f59\u989d\u65f6\uff0c\u629b\u51fa\u5f02\u5e38\n            throw new InsufficientBalanceException(&quot;\u4f59\u989d\u4e0d\u8db3\uff0c\u65e0\u6cd5\u53d6\u51fa &quot; + amount + &quot; \u5143\u3002&quot;);\n        }\n        balance -= amount;\n        System.out.println(&quot;\u6210\u529f\u53d6\u51fa &quot; + amount + &quot; \u5143\uff0c\u5f53\u524d\u4f59\u989d\u4e3a &quot; + balance + &quot; \u5143\u3002&quot;);\n    }\n}<\/code><\/pre>\n<p><strong>\u6d4b\u8bd5\u4ee3\u7801<\/strong><\/p>\n<pre><code class=\"language-java\">\/\/ \u6d4b\u8bd5\u7c7b\npublic class CustomExceptionTest {\n    public static void main(String[] args) {\n        \/\/ \u521b\u5efa\u4e00\u4e2a\u521d\u59cb\u4f59\u989d\u4e3a 1000 \u5143\u7684\u94f6\u884c\u8d26\u6237\n        BankAccount account = new BankAccount(1000);\n\n        try {\n            \/\/ \u5c1d\u8bd5\u53d6\u6b3e 1500 \u5143\n            account.withdraw(1500);\n        } catch (InsufficientBalanceException e) {\n            \/\/ \u6355\u83b7\u5e76\u5904\u7406\u5f02\u5e38\uff0c\u8f93\u51fa\u5f02\u5e38\u4fe1\u606f\n            System.out.println(&quot;\u6355\u83b7\u5230\u5f02\u5e38: &quot; + e.getMessage());\n        }\n\n        try {\n            \/\/ \u5c1d\u8bd5\u53d6\u6b3e 500 \u5143\n            account.withdraw(500);\n        } catch (InsufficientBalanceException e) {\n            System.out.println(&quot;\u6355\u83b7\u5230\u5f02\u5e38: &quot; + e.getMessage());\n        }\n    }\n}<\/code><\/pre>\n<p>\u8fd0\u884c\u7ed3\u679c\uff1a<\/p>\n<blockquote>\n<p>\u6355\u83b7\u5230\u5f02\u5e38: \u4f59\u989d\u4e0d\u8db3\uff0c\u65e0\u6cd5\u53d6\u51fa 1500.0 \u5143\u3002<br \/>\n\u6210\u529f\u53d6\u51fa 500.0 \u5143\uff0c\u5f53\u524d\u4f59\u989d\u4e3a 500.0 \u5143\u3002<\/p>\n<\/blockquote>\n<p><strong>\u4ee3\u7801\u89e3\u91ca<\/strong><\/p>\n<ul>\n<li><strong>\u81ea\u5b9a\u4e49\u5f02\u5e38\u7c7b <code>InsufficientBalanceException<\/code><\/strong>\uff1a\u7ee7\u627f\u81ea <code>Exception<\/code>\uff0c\u8868\u793a\u8fd9\u662f\u4e00\u4e2a\u53d7\u68c0\u5f02\u5e38\u3002\u5b83\u5305\u542b\u4e00\u4e2a\u6784\u9020\u65b9\u6cd5\uff0c\u7528\u4e8e\u63a5\u6536\u5f02\u5e38\u4fe1\u606f\u5e76\u4f20\u9012\u7ed9\u7236\u7c7b\u3002<\/li>\n<li><strong>\u94f6\u884c\u8d26\u6237\u7c7b <code>BankAccount<\/code><\/strong>\uff1a\u5305\u542b\u4e00\u4e2a <code>balance<\/code> \u5b57\u6bb5\u8868\u793a\u8d26\u6237\u4f59\u989d\uff0c\u4ee5\u53ca\u4e00\u4e2a <code>withdraw<\/code> \u65b9\u6cd5\u7528\u4e8e\u53d6\u6b3e\u3002\u5728 <code>withdraw<\/code> \u65b9\u6cd5\u4e2d\uff0c\u5982\u679c\u53d6\u6b3e\u91d1\u989d\u5927\u4e8e\u8d26\u6237\u4f59\u989d\uff0c\u5c31\u4f1a\u629b\u51fa <code>InsufficientBalanceException<\/code> \u5f02\u5e38\u3002<\/li>\n<li><strong>\u6d4b\u8bd5\u7c7b <code>CustomExceptionTest<\/code><\/strong>\uff1a\u521b\u5efa\u4e00\u4e2a\u94f6\u884c\u8d26\u6237\u5bf9\u8c61\uff0c\u5206\u522b\u5c1d\u8bd5\u53d6\u6b3e 1500 \u5143\u548c 500 \u5143\uff0c\u5e76\u4f7f\u7528 <code>try-catch<\/code> \u5757\u6355\u83b7\u548c\u5904\u7406\u53ef\u80fd\u629b\u51fa\u7684 <code>InsufficientBalanceException<\/code> \u5f02\u5e38\u3002<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u5f02\u5e38\u7684\u6982\u5ff5\u3001\u5f02\u5e38\u7684\u5206\u7c7b\u3001try-catch-finally\u8bed\u53e5\u3001\u81ea\u5b9a\u4e49\u5f02\u5e38<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[58,84],"tags":[86,87,85],"class_list":{"0":"post-1343","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"hentry","6":"category-java_base","7":"category-interview","8":"tag-java","10":"tag-85"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u9762\u8bd5\u7b14\u8bb003-Java\u57fa\u7840\uff08\u4e09\uff09\uff1a\u5f02\u5e38\u5904\u7406 | \u9676\u5176\u7684\u4e2a\u4eba\u535a\u5ba2<\/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.tqazy.com\/?p=1343\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u9762\u8bd5\u7b14\u8bb003-Java\u57fa\u7840\uff08\u4e09\uff09\uff1a\u5f02\u5e38\u5904\u7406 | \u9676\u5176\u7684\u4e2a\u4eba\u535a\u5ba2\" \/>\n<meta property=\"og:description\" content=\"\u5f02\u5e38\u7684\u6982\u5ff5\u3001\u5f02\u5e38\u7684\u5206\u7c7b\u3001try-catch-finally\u8bed\u53e5\u3001\u81ea\u5b9a\u4e49\u5f02\u5e38\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.tqazy.com\/?p=1343\" \/>\n<meta property=\"og:site_name\" content=\"\u9676\u5176\u7684\u4e2a\u4eba\u535a\u5ba2\" \/>\n<meta property=\"article:published_time\" content=\"2025-02-25T07:58:57+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-02-25T08:17:25+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/oss.tqazy.com\/wordpress\/autoFile\/2024\/05\/20240530090910445.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1920\" \/>\n\t<meta property=\"og:image:height\" content=\"1080\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"\u9676\u5176\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u9676\u5176\" \/>\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\":\"Article\",\"@id\":\"https:\/\/www.tqazy.com\/?p=1343#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.tqazy.com\/?p=1343\"},\"author\":{\"name\":\"\u9676\u5176\",\"@id\":\"https:\/\/www.tqazy.com\/#\/schema\/person\/b2e89d56e70f15c261012417c5ef2c4e\"},\"headline\":\"\u9762\u8bd5\u7b14\u8bb003-Java\u57fa\u7840\uff08\u4e09\uff09\uff1a\u5f02\u5e38\u5904\u7406\",\"datePublished\":\"2025-02-25T07:58:57+00:00\",\"dateModified\":\"2025-02-25T08:17:25+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.tqazy.com\/?p=1343\"},\"wordCount\":22,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.tqazy.com\/#\/schema\/person\/b2e89d56e70f15c261012417c5ef2c4e\"},\"keywords\":[\"Java\",\"Java\u57fa\u7840\",\"\u9762\u8bd5\u516b\u80a1\"],\"articleSection\":[\"Java\u57fa\u7840\",\"\u9762\u8bd5\u516b\u80a1\"],\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.tqazy.com\/?p=1343#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.tqazy.com\/?p=1343\",\"url\":\"https:\/\/www.tqazy.com\/?p=1343\",\"name\":\"\u9762\u8bd5\u7b14\u8bb003-Java\u57fa\u7840\uff08\u4e09\uff09\uff1a\u5f02\u5e38\u5904\u7406 | \u9676\u5176\u7684\u4e2a\u4eba\u535a\u5ba2\",\"isPartOf\":{\"@id\":\"https:\/\/www.tqazy.com\/#website\"},\"datePublished\":\"2025-02-25T07:58:57+00:00\",\"dateModified\":\"2025-02-25T08:17:25+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.tqazy.com\/?p=1343#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.tqazy.com\/?p=1343\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.tqazy.com\/?p=1343#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.tqazy.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u9762\u8bd5\u7b14\u8bb003-Java\u57fa\u7840\uff08\u4e09\uff09\uff1a\u5f02\u5e38\u5904\u7406\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.tqazy.com\/#website\",\"url\":\"https:\/\/www.tqazy.com\/\",\"name\":\"\u9676\u5176\u7684\u4e2a\u4eba\u535a\u5ba2\",\"description\":\"\u5f53\u4e0b\uff0c\u5373\u662f\u672a\u6765\",\"publisher\":{\"@id\":\"https:\/\/www.tqazy.com\/#\/schema\/person\/b2e89d56e70f15c261012417c5ef2c4e\"},\"alternateName\":\"TaoQi's Blog\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.tqazy.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"zh-Hans\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/www.tqazy.com\/#\/schema\/person\/b2e89d56e70f15c261012417c5ef2c4e\",\"name\":\"\u9676\u5176\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.tqazy.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/oss.tqazy.com\/wordpress\/autoFile\/2024\/06\/20240604021741672.jpg\",\"contentUrl\":\"https:\/\/oss.tqazy.com\/wordpress\/autoFile\/2024\/06\/20240604021741672.jpg\",\"width\":940,\"height\":940,\"caption\":\"\u9676\u5176\"},\"logo\":{\"@id\":\"https:\/\/www.tqazy.com\/#\/schema\/person\/image\/\"},\"description\":\"\u4e00\u4e2a\u5f88\u61d2\u7684\u7a0b\u5e8f\u5458\",\"sameAs\":[\"https:\/\/www.tqazy.com\"],\"url\":\"https:\/\/www.tqazy.com\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u9762\u8bd5\u7b14\u8bb003-Java\u57fa\u7840\uff08\u4e09\uff09\uff1a\u5f02\u5e38\u5904\u7406 | \u9676\u5176\u7684\u4e2a\u4eba\u535a\u5ba2","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.tqazy.com\/?p=1343","og_locale":"zh_CN","og_type":"article","og_title":"\u9762\u8bd5\u7b14\u8bb003-Java\u57fa\u7840\uff08\u4e09\uff09\uff1a\u5f02\u5e38\u5904\u7406 | \u9676\u5176\u7684\u4e2a\u4eba\u535a\u5ba2","og_description":"\u5f02\u5e38\u7684\u6982\u5ff5\u3001\u5f02\u5e38\u7684\u5206\u7c7b\u3001try-catch-finally\u8bed\u53e5\u3001\u81ea\u5b9a\u4e49\u5f02\u5e38","og_url":"https:\/\/www.tqazy.com\/?p=1343","og_site_name":"\u9676\u5176\u7684\u4e2a\u4eba\u535a\u5ba2","article_published_time":"2025-02-25T07:58:57+00:00","article_modified_time":"2025-02-25T08:17:25+00:00","og_image":[{"width":1920,"height":1080,"url":"https:\/\/oss.tqazy.com\/wordpress\/autoFile\/2024\/05\/20240530090910445.jpg","type":"image\/jpeg"}],"author":"\u9676\u5176","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u9676\u5176","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.tqazy.com\/?p=1343#article","isPartOf":{"@id":"https:\/\/www.tqazy.com\/?p=1343"},"author":{"name":"\u9676\u5176","@id":"https:\/\/www.tqazy.com\/#\/schema\/person\/b2e89d56e70f15c261012417c5ef2c4e"},"headline":"\u9762\u8bd5\u7b14\u8bb003-Java\u57fa\u7840\uff08\u4e09\uff09\uff1a\u5f02\u5e38\u5904\u7406","datePublished":"2025-02-25T07:58:57+00:00","dateModified":"2025-02-25T08:17:25+00:00","mainEntityOfPage":{"@id":"https:\/\/www.tqazy.com\/?p=1343"},"wordCount":22,"commentCount":0,"publisher":{"@id":"https:\/\/www.tqazy.com\/#\/schema\/person\/b2e89d56e70f15c261012417c5ef2c4e"},"keywords":["Java","Java\u57fa\u7840","\u9762\u8bd5\u516b\u80a1"],"articleSection":["Java\u57fa\u7840","\u9762\u8bd5\u516b\u80a1"],"inLanguage":"zh-Hans","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.tqazy.com\/?p=1343#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.tqazy.com\/?p=1343","url":"https:\/\/www.tqazy.com\/?p=1343","name":"\u9762\u8bd5\u7b14\u8bb003-Java\u57fa\u7840\uff08\u4e09\uff09\uff1a\u5f02\u5e38\u5904\u7406 | \u9676\u5176\u7684\u4e2a\u4eba\u535a\u5ba2","isPartOf":{"@id":"https:\/\/www.tqazy.com\/#website"},"datePublished":"2025-02-25T07:58:57+00:00","dateModified":"2025-02-25T08:17:25+00:00","breadcrumb":{"@id":"https:\/\/www.tqazy.com\/?p=1343#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.tqazy.com\/?p=1343"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.tqazy.com\/?p=1343#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.tqazy.com\/"},{"@type":"ListItem","position":2,"name":"\u9762\u8bd5\u7b14\u8bb003-Java\u57fa\u7840\uff08\u4e09\uff09\uff1a\u5f02\u5e38\u5904\u7406"}]},{"@type":"WebSite","@id":"https:\/\/www.tqazy.com\/#website","url":"https:\/\/www.tqazy.com\/","name":"\u9676\u5176\u7684\u4e2a\u4eba\u535a\u5ba2","description":"\u5f53\u4e0b\uff0c\u5373\u662f\u672a\u6765","publisher":{"@id":"https:\/\/www.tqazy.com\/#\/schema\/person\/b2e89d56e70f15c261012417c5ef2c4e"},"alternateName":"TaoQi's Blog","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.tqazy.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"zh-Hans"},{"@type":["Person","Organization"],"@id":"https:\/\/www.tqazy.com\/#\/schema\/person\/b2e89d56e70f15c261012417c5ef2c4e","name":"\u9676\u5176","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.tqazy.com\/#\/schema\/person\/image\/","url":"https:\/\/oss.tqazy.com\/wordpress\/autoFile\/2024\/06\/20240604021741672.jpg","contentUrl":"https:\/\/oss.tqazy.com\/wordpress\/autoFile\/2024\/06\/20240604021741672.jpg","width":940,"height":940,"caption":"\u9676\u5176"},"logo":{"@id":"https:\/\/www.tqazy.com\/#\/schema\/person\/image\/"},"description":"\u4e00\u4e2a\u5f88\u61d2\u7684\u7a0b\u5e8f\u5458","sameAs":["https:\/\/www.tqazy.com"],"url":"https:\/\/www.tqazy.com\/?author=1"}]}},"_links":{"self":[{"href":"https:\/\/www.tqazy.com\/index.php?rest_route=\/wp\/v2\/posts\/1343","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.tqazy.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tqazy.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tqazy.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tqazy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1343"}],"version-history":[{"count":24,"href":"https:\/\/www.tqazy.com\/index.php?rest_route=\/wp\/v2\/posts\/1343\/revisions"}],"predecessor-version":[{"id":1367,"href":"https:\/\/www.tqazy.com\/index.php?rest_route=\/wp\/v2\/posts\/1343\/revisions\/1367"}],"wp:attachment":[{"href":"https:\/\/www.tqazy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1343"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tqazy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1343"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tqazy.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1343"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}