{"id":2228,"date":"2025-03-02T10:48:02","date_gmt":"2025-03-02T02:48:02","guid":{"rendered":"https:\/\/www.laixuexila.com\/?p=2228"},"modified":"2025-03-02T10:48:02","modified_gmt":"2025-03-02T02:48:02","slug":"java-%e9%87%8d%e5%86%99override%e4%b8%8e%e9%87%8d%e8%bd%bdoverload","status":"publish","type":"post","link":"https:\/\/www.laixuexila.com\/index.php\/2025\/03\/02\/java-%e9%87%8d%e5%86%99override%e4%b8%8e%e9%87%8d%e8%bd%bdoverload\/","title":{"rendered":"Java \u91cd\u5199(Override)\u4e0e\u91cd\u8f7d(Overload)"},"content":{"rendered":"\n<p>\u5728 Java \u4e2d\uff0c<strong>\u91cd\u5199\uff08Override\uff09<\/strong>\u00a0\u548c\u00a0<strong>\u91cd\u8f7d\uff08Overload\uff09<\/strong>\u00a0\u90fd\u662f\u65b9\u6cd5\u591a\u6001\u6027\u76f8\u5173\u7684\u6982\u5ff5\uff0c\u4f46\u5b83\u4eec\u7684\u5b9e\u73b0\u65b9\u5f0f\u548c\u4f5c\u7528\u5b8c\u5168\u4e0d\u540c\u3002\u7406\u89e3\u8fd9\u4e24\u8005\u7684\u533a\u522b\u662f\u975e\u5e38\u91cd\u8981\u7684\u3002\u4e0b\u9762\u5c06\u8be6\u7ec6\u89e3\u91ca\u5b83\u4eec\u7684\u6982\u5ff5\u3001\u7279\u70b9\u548c\u533a\u522b\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>\u4e00\u3001\u65b9\u6cd5\u91cd\u5199\uff08Override\uff09<\/strong><\/h3>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>1. \u65b9\u6cd5\u91cd\u5199\u7684\u672c\u8d28<\/strong><\/h4>\n\n\n\n<p>\u65b9\u6cd5\u91cd\u5199\u662f <strong>\u7ee7\u627f<\/strong> \u5173\u7cfb\u4e2d\u7684\u4e00\u79cd\u7279\u6027\u3002\u901a\u8fc7\u65b9\u6cd5\u91cd\u5199\uff0c\u5b50\u7c7b\u53ef\u4ee5\u6539\u53d8\u4ece\u7236\u7c7b\u7ee7\u627f\u7684\u65b9\u6cd5\u7684\u884c\u4e3a\u3002\u91cd\u5199\u662f\u591a\u6001\u7684\u5b9e\u73b0\u65b9\u5f0f\u4e4b\u4e00\uff0c\u53ef\u4ee5\u5728\u8fd0\u884c\u65f6\u51b3\u5b9a\u8c03\u7528\u54ea\u4e2a\u7c7b\u7684\u65b9\u6cd5\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u591a\u6001\u6027<\/strong>\uff1a\u91cd\u5199\u4f7f\u5f97\u7a0b\u5e8f\u5728\u8fd0\u884c\u65f6\u51b3\u5b9a\u8c03\u7528\u7236\u7c7b\u8fd8\u662f\u5b50\u7c7b\u7684\u65b9\u6cd5\uff0c\u8fd9\u662f Java \u7684<strong>\u8fd0\u884c\u65f6\u591a\u6001<\/strong>\uff08Dynamic Polymorphism\uff09\u7684\u4f53\u73b0\u3002<\/li>\n\n\n\n<li><strong>\u65b9\u6cd5\u7b7e\u540d<\/strong>\uff1a\u91cd\u5199\u8981\u6c42\u7236\u7c7b\u548c\u5b50\u7c7b\u7684\u65b9\u6cd5\u6709\u76f8\u540c\u7684\u65b9\u6cd5\u7b7e\u540d\uff0c\u8fd9\u610f\u5473\u7740\u65b9\u6cd5\u540d\u548c\u53c2\u6570\u5217\u8868\u5b8c\u5168\u4e00\u81f4\u3002\u8fd9\u662f\u4e3a\u4e86\u4fdd\u8bc1\u5b50\u7c7b\u65b9\u6cd5\u53ef\u4ee5\u66ff\u4ee3\u7236\u7c7b\u65b9\u6cd5\u3002<\/li>\n\n\n\n<li><strong><code>@Override<\/code> \u6ce8\u89e3<\/strong>\uff1a\u4f7f\u7528 <code>@Override<\/code> \u6ce8\u89e3\u53ef\u4ee5\u5e2e\u52a9\u7f16\u8bd1\u5668\u68c0\u67e5\u662f\u5426\u771f\u7684\u91cd\u5199\u4e86\u7236\u7c7b\u7684\u65b9\u6cd5\u3002\u5982\u679c\u6ca1\u6709\u6b63\u786e\u91cd\u5199\uff0c\u4f1a\u4ea7\u751f\u7f16\u8bd1\u9519\u8bef\u3002<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>2. \u5173\u952e\u70b9\u89e3\u6790<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u534f\u53d8\u8fd4\u56de\u7c7b\u578b<\/strong>\uff1aJava \u5141\u8bb8\u5b50\u7c7b\u65b9\u6cd5\u7684\u8fd4\u56de\u7c7b\u578b\u662f\u7236\u7c7b\u65b9\u6cd5\u8fd4\u56de\u7c7b\u578b\u7684\u5b50\u7c7b\u578b\u3002\u4f8b\u5982\uff0c\u7236\u7c7b\u8fd4\u56de <code>Object<\/code> \u7c7b\u578b\uff0c\u5b50\u7c7b\u53ef\u4ee5\u8fd4\u56de <code>String<\/code> \u7c7b\u578b\uff0c\u56e0\u4e3a <code>String<\/code> \u662f <code>Object<\/code> \u7684\u5b50\u7c7b\u3002\u8fd9\u79cd\u73b0\u8c61\u53eb\u505a<strong>\u534f\u53d8\u8fd4\u56de\u7c7b\u578b<\/strong>\u3002<\/li>\n\n\n\n<li><strong>\u8bbf\u95ee\u6743\u9650<\/strong>\uff1a\u5b50\u7c7b\u91cd\u5199\u7236\u7c7b\u65b9\u6cd5\u65f6\uff0c\u5b50\u7c7b\u65b9\u6cd5\u7684\u8bbf\u95ee\u6743\u9650\u4e0d\u80fd\u6bd4\u7236\u7c7b\u65b9\u6cd5\u66f4\u4e25\u683c\u3002\u5373\u5982\u679c\u7236\u7c7b\u65b9\u6cd5\u662f <code>public<\/code>\uff0c\u90a3\u4e48\u5b50\u7c7b\u65b9\u6cd5\u4e5f\u5fc5\u987b\u662f <code>public<\/code>\uff1b\u5982\u679c\u7236\u7c7b\u65b9\u6cd5\u662f <code>protected<\/code>\uff0c\u5b50\u7c7b\u53ef\u4ee5\u4f7f\u7528 <code>protected<\/code> \u6216 <code>public<\/code>\uff0c\u4f46\u4e0d\u80fd\u7528 <code>private<\/code>\u3002<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>3. \u8fd0\u884c\u65f6\u591a\u6001\u7684\u793a\u4f8b<\/strong><\/h4>\n\n\n\n<p>\u5728\u65b9\u6cd5\u91cd\u5199\u4e2d\uff0c\u7236\u7c7b\u5f15\u7528\u6307\u5411\u5b50\u7c7b\u5bf9\u8c61\u65f6\uff0c\u8c03\u7528\u7684\u65b9\u6cd5\u662f\u5b50\u7c7b\u91cd\u5199\u7684\u65b9\u6cd5\uff0c\u800c\u4e0d\u662f\u7236\u7c7b\u7684\u65b9\u6cd5\u3002\u8fd9\u79cd\u673a\u5236\u662f\u5b9e\u73b0 <strong>\u8fd0\u884c\u65f6\u591a\u6001<\/strong> \u7684\u5173\u952e\u3002<\/p>\n\n\n\n<p><strong>\u793a\u4f8b\uff1a<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>class Animal {\n    void sound() {\n        System.out.println(\"\u52a8\u7269\u53d1\u51fa\u58f0\u97f3\");\n    }\n}\n\nclass Dog extends Animal {\n    @Override\n    void sound() {\n        System.out.println(\"\u72d7\u53eb\uff1a\u6c6a\u6c6a\");\n    }\n}\n\npublic class Test {\n    public static void main(String&#91;] args) {\n        Animal animal = new Dog();  \/\/ \u7236\u7c7b\u5f15\u7528\u6307\u5411\u5b50\u7c7b\u5bf9\u8c61\n        animal.sound();  \/\/ \u8c03\u7528 Dog \u7c7b\u4e2d\u7684 sound() \u65b9\u6cd5\n    }\n}<\/code><\/pre>\n\n\n\n<p><strong>\u8f93\u51fa:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\u72d7\u53eb\uff1a\u6c6a\u6c6a<\/code><\/pre>\n\n\n\n<p>\u89e3\u91ca\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u867d\u7136 <code>animal<\/code> \u662f <code>Animal<\/code> \u7c7b\u578b\u7684\u5f15\u7528\uff0c\u4f46\u5b83\u6307\u5411\u7684\u662f <code>Dog<\/code> \u7c7b\u578b\u7684\u5bf9\u8c61\uff0c\u8c03\u7528\u7684\u662f <code>Dog<\/code> \u7c7b\u4e2d\u91cd\u5199\u7684 <code>sound()<\/code> \u65b9\u6cd5\u3002<\/li>\n\n\n\n<li>\u8fd9\u5c31\u662f <strong>\u8fd0\u884c\u65f6\u591a\u6001<\/strong>\uff0c\u5728\u6267\u884c\u65f6\u51b3\u5b9a\u8c03\u7528\u54ea\u4e00\u4e2a\u65b9\u6cd5\u3002<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>\u4e8c\u3001\u65b9\u6cd5\u91cd\u8f7d\uff08Overload\uff09<\/strong><\/h3>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>1. \u65b9\u6cd5\u91cd\u8f7d\u7684\u672c\u8d28<\/strong><\/h4>\n\n\n\n<p>\u65b9\u6cd5\u91cd\u8f7d\u53d1\u751f\u5728 <strong>\u540c\u4e00\u4e2a\u7c7b\u4e2d<\/strong>\uff0c\u662f\u901a\u8fc7\u521b\u5efa\u591a\u4e2a\u5177\u6709\u76f8\u540c\u65b9\u6cd5\u540d\u3001\u4e0d\u540c\u53c2\u6570\u5217\u8868\u7684\u65b9\u6cd5\u6765\u589e\u5f3a\u7c7b\u7684\u529f\u80fd\u3002\u91cd\u8f7d\u5e76\u4e0d\u6d89\u53ca\u7ee7\u627f\u5173\u7cfb\uff0c\u800c\u662f\u7f16\u8bd1\u5668\u6839\u636e\u65b9\u6cd5\u8c03\u7528\u65f6\u4f20\u5165\u7684\u53c2\u6570\u7c7b\u578b\u6765\u51b3\u5b9a\u4f7f\u7528\u54ea\u4e2a\u65b9\u6cd5\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u7f16\u8bd1\u65f6\u591a\u6001<\/strong>\uff1a\u65b9\u6cd5\u91cd\u8f7d\u662f <strong>\u7f16\u8bd1\u65f6\u591a\u6001<\/strong>\uff08Static Polymorphism\uff09\u7684\u4f53\u73b0\uff0c\u5373\u7f16\u8bd1\u5668\u6839\u636e\u4f20\u9012\u7ed9\u65b9\u6cd5\u7684\u53c2\u6570\u7c7b\u578b\u6765\u9009\u62e9\u8c03\u7528\u54ea\u4e2a\u65b9\u6cd5\u3002<\/li>\n\n\n\n<li><strong>\u91cd\u8f7d\u7684\u9009\u62e9\u89c4\u5219<\/strong>\uff1a\u7f16\u8bd1\u5668\u6839\u636e\u8c03\u7528\u65f6\u4f20\u9012\u7684\u53c2\u6570\u7c7b\u578b\u6765\u9009\u62e9\u91cd\u8f7d\u7684\u65b9\u6cd5\u3002\u65b9\u6cd5\u91cd\u8f7d\u53ef\u4ee5\u901a\u8fc7\u6539\u53d8\u65b9\u6cd5\u7684\u53c2\u6570\u4e2a\u6570\u3001\u7c7b\u578b\u6216\u8005\u987a\u5e8f\u6765\u5b9e\u73b0\u3002<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>2. \u5173\u952e\u70b9\u89e3\u6790<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u8fd4\u56de\u7c7b\u578b\u4e0d\u540c\u4e0d\u7b97\u91cd\u8f7d<\/strong>\uff1a\u65b9\u6cd5\u7684\u8fd4\u56de\u7c7b\u578b\u53ef\u4ee5\u4e0d\u540c\uff0c\u4f46\u4ec5\u51ed\u8fd4\u56de\u7c7b\u578b\u7684\u4e0d\u540c\u662f\u65e0\u6cd5\u5b9e\u73b0\u65b9\u6cd5\u91cd\u8f7d\u7684\u3002\u5fc5\u987b\u4f9d\u8d56\u4e8e\u53c2\u6570\u5217\u8868\u7684\u4e0d\u540c\u6765\u5b9e\u73b0\u65b9\u6cd5\u91cd\u8f7d\u3002<\/li>\n\n\n\n<li><strong>\u53c2\u6570\u7c7b\u578b\u4e0d\u540c\u6216\u987a\u5e8f\u4e0d\u540c<\/strong>\uff1a\u53c2\u6570\u7c7b\u578b\u6216\u53c2\u6570\u7684\u987a\u5e8f\u4e0d\u540c\uff0c\u7f16\u8bd1\u5668\u4f1a\u6839\u636e\u4f20\u5165\u7684\u53c2\u6570\u6765\u51b3\u5b9a\u8c03\u7528\u54ea\u4e2a\u91cd\u8f7d\u7684\u65b9\u6cd5\u3002<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>3. \u7f16\u8bd1\u65f6\u591a\u6001\u7684\u793a\u4f8b<\/strong><\/h4>\n\n\n\n<p>\u5728\u65b9\u6cd5\u91cd\u8f7d\u4e2d\uff0c\u7f16\u8bd1\u5668\u6839\u636e\u65b9\u6cd5\u8c03\u7528\u65f6\u4f20\u5165\u7684\u53c2\u6570\u6765\u51b3\u5b9a\u4f7f\u7528\u54ea\u4e2a\u65b9\u6cd5\u3002<\/p>\n\n\n\n<p><strong>\u793a\u4f8b\uff1a<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>class Calculator {\n    \/\/ \u52a0\u6cd5\u65b9\u6cd5\uff08\u4e24\u4e2a\u6574\u578b\u6570\u76f8\u52a0\uff09\n    int add(int a, int b) {\n        return a + b;\n    }\n\n    \/\/ \u52a0\u6cd5\u65b9\u6cd5\uff08\u4e24\u4e2a\u6d6e\u70b9\u6570\u76f8\u52a0\uff09\n    double add(double a, double b) {\n        return a + b;\n    }\n\n    \/\/ \u52a0\u6cd5\u65b9\u6cd5\uff08\u4e09\u4e2a\u6574\u578b\u6570\u76f8\u52a0\uff09\n    int add(int a, int b, int c) {\n        return a + b + c;\n    }\n}\n\npublic class Test {\n    public static void main(String&#91;] args) {\n        Calculator calc = new Calculator();\n\n        \/\/ \u8c03\u7528\u4e0d\u540c\u7684\u91cd\u8f7d\u65b9\u6cd5\n        System.out.println(calc.add(2, 3));       \/\/ \u8f93\u51fa 5\n        System.out.println(calc.add(2.5, 3.5));   \/\/ \u8f93\u51fa 6.0\n        System.out.println(calc.add(1, 2, 3));    \/\/ \u8f93\u51fa 6\n    }\n}<\/code><\/pre>\n\n\n\n<p><strong>\u8f93\u51fa:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>5\n6.0\n6<\/code><\/pre>\n\n\n\n<p>\u89e3\u91ca\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u6839\u636e\u4f20\u5165\u7684\u53c2\u6570\uff0c\u7f16\u8bd1\u5668\u9009\u62e9\u8c03\u7528\u4e0d\u540c\u7684 <code>add<\/code> \u65b9\u6cd5\u3002<\/li>\n\n\n\n<li>\u8fd9\u662f <strong>\u7f16\u8bd1\u65f6\u591a\u6001<\/strong>\uff0c\u5728\u7f16\u8bd1\u9636\u6bb5\u6839\u636e\u53c2\u6570\u7c7b\u578b\u51b3\u5b9a\u8c03\u7528\u54ea\u4e2a\u65b9\u6cd5\u3002<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>\u4e09\u3001\u91cd\u5199\u4e0e\u91cd\u8f7d\u7684\u533a\u522b\u603b\u7ed3<\/strong><\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th><strong>\u533a\u522b<\/strong><\/th><th><strong>\u65b9\u6cd5\u91cd\u5199\uff08Override\uff09<\/strong><\/th><th><strong>\u65b9\u6cd5\u91cd\u8f7d\uff08Overload\uff09<\/strong><\/th><\/tr><\/thead><tbody><tr><td><strong>\u5b9a\u4e49<\/strong><\/td><td>\u5b50\u7c7b\u91cd\u65b0\u5b9e\u73b0\u7236\u7c7b\u7684\u65b9\u6cd5\uff0c\u6539\u53d8\u7236\u7c7b\u65b9\u6cd5\u7684\u884c\u4e3a\u3002<\/td><td>\u540c\u4e00\u7c7b\u4e2d\u65b9\u6cd5\u540d\u76f8\u540c\uff0c\u4f46\u53c2\u6570\u4e0d\u540c\u7684\u65b9\u6cd5\u3002<\/td><\/tr><tr><td><strong>\u65b9\u6cd5\u7b7e\u540d<\/strong><\/td><td>\u65b9\u6cd5\u540d\u3001\u53c2\u6570\u5217\u8868\u3001\u8fd4\u56de\u7c7b\u578b\u90fd\u5fc5\u987b\u76f8\u540c\uff08\u6216\u7b26\u5408\u534f\u53d8\u8fd4\u56de\u7c7b\u578b\uff09\u3002<\/td><td>\u65b9\u6cd5\u540d\u76f8\u540c\uff0c\u4f46\u53c2\u6570\u5217\u8868\u5fc5\u987b\u4e0d\u540c\uff08\u6570\u91cf\u6216\u7c7b\u578b\uff09\u3002<\/td><\/tr><tr><td><strong>\u53d1\u751f\u4f4d\u7f6e<\/strong><\/td><td>\u5b50\u7c7b\u5bf9\u7236\u7c7b\u65b9\u6cd5\u7684\u91cd\u5199\u3002<\/td><td>\u5728\u540c\u4e00\u4e2a\u7c7b\u4e2d\u5b9a\u4e49\u591a\u4e2a\u65b9\u6cd5\u3002<\/td><\/tr><tr><td><strong>\u591a\u6001<\/strong><\/td><td>\u901a\u8fc7\u591a\u6001\u5b9e\u73b0\uff08\u7236\u7c7b\u5f15\u7528\u6307\u5411\u5b50\u7c7b\u5bf9\u8c61\uff0c\u8c03\u7528\u5b50\u7c7b\u7684\u65b9\u6cd5\uff09\u3002<\/td><td>\u65e0\u6cd5\u5b9e\u73b0\u591a\u6001\uff0c\u65b9\u6cd5\u91cd\u8f7d\u4ec5\u4f9d\u8d56\u4e8e\u53c2\u6570\u5217\u8868\u7684\u4e0d\u540c\u3002<\/td><\/tr><tr><td><strong>\u8bbf\u95ee\u6743\u9650<\/strong><\/td><td>\u5b50\u7c7b\u65b9\u6cd5\u7684\u8bbf\u95ee\u6743\u9650\u4e0d\u80fd\u6bd4\u7236\u7c7b\u65b9\u6cd5\u66f4\u4e25\u683c\u3002<\/td><td>\u8bbf\u95ee\u6743\u9650\u4e0d\u53d7\u5f71\u54cd\uff0c\u53ef\u4ee5\u4e0e\u539f\u65b9\u6cd5\u76f8\u540c\u6216\u4e0d\u540c\u3002<\/td><\/tr><tr><td><strong>\u8fd4\u56de\u7c7b\u578b<\/strong><\/td><td>\u8fd4\u56de\u7c7b\u578b\u53ef\u4ee5\u662f\u7236\u7c7b\u65b9\u6cd5\u8fd4\u56de\u7c7b\u578b\u7684\u5b50\u7c7b\uff08\u534f\u53d8\u8fd4\u56de\u7c7b\u578b\uff09\u3002<\/td><td>\u8fd4\u56de\u7c7b\u578b\u53ef\u4ee5\u4e0d\u540c\u3002<\/td><\/tr><tr><td><strong>\u7f16\u8bd1\u65f6\u8fd8\u662f\u8fd0\u884c\u65f6<\/strong><\/td><td>\u8fd0\u884c\u65f6\u51b3\u5b9a\uff08\u8fd0\u884c\u65f6\u591a\u6001\uff09\u3002<\/td><td>\u7f16\u8bd1\u65f6\u51b3\u5b9a\uff08\u7f16\u8bd1\u65f6\u591a\u6001\uff09\u3002<\/td><\/tr><tr><td><strong><code>super<\/code> \u5173\u952e\u5b57\u4f7f\u7528<\/strong><\/td><td>\u53ef\u4ee5\u901a\u8fc7 <code>super<\/code> \u8c03\u7528\u7236\u7c7b\u7684\u65b9\u6cd5\u3002<\/td><td>\u4e0d\u80fd\u4f7f\u7528 <code>super<\/code> \u8c03\u7528\u91cd\u8f7d\u65b9\u6cd5\uff0c\u56e0\u4e3a\u5b83\u4eec\u5e76\u4e0d\u662f\u7236\u7c7b\u7684\u65b9\u6cd5\u3002<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>\u56db\u3001\u5b9e\u9645\u5e94\u7528\u573a\u666f<\/strong><\/h3>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>\u65b9\u6cd5\u91cd\u5199\u7684\u5e94\u7528\u573a\u666f<\/strong>\uff1a<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u591a\u6001<\/strong>\uff1a\u5728\u5b9e\u73b0\u591a\u6001\u65f6\uff0c\u7236\u7c7b\u5f15\u7528\u6307\u5411\u5b50\u7c7b\u5bf9\u8c61\u65f6\uff0c\u8c03\u7528\u7684\u662f\u5b50\u7c7b\u91cd\u5199\u7684\u65b9\u6cd5\u3002<\/li>\n\n\n\n<li><strong>\u5b9a\u5236\u884c\u4e3a<\/strong>\uff1a\u5728\u7ee7\u627f\u4f53\u7cfb\u4e2d\uff0c\u5b50\u7c7b\u53ef\u80fd\u9700\u8981\u6539\u53d8\u7236\u7c7b\u7684\u65b9\u6cd5\u884c\u4e3a\uff0c\u4f8b\u5982\uff1a<code>Object<\/code> \u7c7b\u4e2d\u7684 <code>toString()<\/code> \u65b9\u6cd5\uff0c\u53ef\u4ee5\u5728\u5b50\u7c7b\u4e2d\u91cd\u5199\u5b83\uff0c\u4ee5\u4fbf\u8fd4\u56de\u66f4\u6709\u610f\u4e49\u7684\u5b57\u7b26\u4e32\u8868\u793a\u3002<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>\u65b9\u6cd5\u91cd\u8f7d\u7684\u5e94\u7528\u573a\u666f<\/strong>\uff1a<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u51fd\u6570\u529f\u80fd\u6269\u5c55<\/strong>\uff1a\u540c\u4e00\u4e2a\u65b9\u6cd5\u540d\u53ef\u4ee5\u5904\u7406\u4e0d\u540c\u7c7b\u578b\u6216\u6570\u91cf\u7684\u8f93\u5165\uff0c\u589e\u5f3a\u4e86\u4ee3\u7801\u7684\u7075\u6d3b\u6027\u548c\u53ef\u8bfb\u6027\u3002<\/li>\n\n\n\n<li><strong>\u53c2\u6570\u53d8\u5316\u5904\u7406<\/strong>\uff1a\u5728\u5b9e\u9645\u5f00\u53d1\u4e2d\uff0c\u4e0d\u540c\u573a\u666f\u4e0b\uff0c\u53ef\u80fd\u9700\u8981\u5bf9\u4e0d\u540c\u7c7b\u578b\u7684\u6570\u636e\u6267\u884c\u76f8\u540c\u7684\u64cd\u4f5c\u3002\u6b64\u65f6\u53ef\u4ee5\u901a\u8fc7\u91cd\u8f7d\u6765\u7b80\u5316\u65b9\u6cd5\u7684\u8bbe\u8ba1\u3002<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>\u603b\u7ed3<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u65b9\u6cd5\u91cd\u8f7d<\/strong> \u662f\u7f16\u8bd1\u65f6\u591a\u6001\uff0c\u7528\u6765\u589e\u52a0\u65b9\u6cd5\u7684\u7075\u6d3b\u6027\uff0c\u53ef\u4ee5\u901a\u8fc7\u6539\u53d8\u53c2\u6570\u7c7b\u578b\u6216\u6570\u91cf\u6765\u5b9e\u73b0\u3002<\/li>\n\n\n\n<li><strong>\u65b9\u6cd5\u91cd\u5199<\/strong> \u662f\u8fd0\u884c\u65f6\u591a\u6001\u7684\u4e00\u90e8\u5206\uff0c\u7528\u4e8e\u6539\u53d8\u7ee7\u627f\u4f53\u7cfb\u4e2d\u7236\u7c7b\u65b9\u6cd5\u7684\u884c\u4e3a\uff0c\u901a\u5e38\u4f34\u968f\u7ee7\u627f\u5173\u7cfb\u6765\u5b9e\u73b0\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u901a\u8fc7\u7406\u89e3\u8fd9\u4e24\u4e2a\u6982\u5ff5\uff0c\u4f60\u53ef\u4ee5\u5728 Java \u7f16\u7a0b\u4e2d\u7075\u6d3b\u8fd0\u7528\u591a\u6001\u548c\u51fd\u6570\u6269\u5c55\uff0c\u63d0\u9ad8\u4ee3\u7801\u7684\u53ef\u7ef4\u62a4\u6027\u548c\u53ef\u8bfb\u6027\u3002\u66f4\u591a\u8be6\u7ec6\u5185\u5bb9\u8bf7\u5173\u6ce8\u5176\u4ed6\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728 Java \u4e2d\uff0c\u91cd\u5199\uff08Override\uff09\u00a0\u548c\u00a0\u91cd\u8f7d\uff08Overload\uff09\u00a0\u90fd\u662f\u65b9\u6cd5\u591a\u6001\u6027\u76f8\u5173\u7684\u6982\u5ff5\uff0c\u4f46\u5b83\u4eec\u7684\u5b9e [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[68],"tags":[],"class_list":["post-2228","post","type-post","status-publish","format-standard","hentry","category-java"],"_links":{"self":[{"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/posts\/2228","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/comments?post=2228"}],"version-history":[{"count":1,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/posts\/2228\/revisions"}],"predecessor-version":[{"id":2229,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/posts\/2228\/revisions\/2229"}],"wp:attachment":[{"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/media?parent=2228"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/categories?post=2228"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/tags?post=2228"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}