\u4e00\u3001\u62bd\u8c61\u7c7b<\/strong><\/div>\n\u5728\u4e86\u89e3\u62bd\u8c61\u7c7b\u4e4b\u524d\uff0c\u5148\u6765\u4e86\u89e3\u4e00\u4e0b\u62bd\u8c61\u65b9\u6cd5\u3002\u62bd\u8c61\u65b9\u6cd5\u662f\u4e00\u79cd\u7279\u6b8a\u7684\u65b9\u6cd5\uff1a\u5b83\u53ea\u6709\u58f0\u660e\uff0c\u800c\u6ca1\u6709\u5177\u4f53\u7684\u5b9e\u73b0\u3002\u62bd\u8c61\u65b9\u6cd5\u7684\u58f0\u660e\u683c\u5f0f\u4e3a\uff1a<\/p>\n
abstract void fun();<\/pre>\n\u62bd\u8c61\u65b9\u6cd5\u5fc5\u987b\u7528 abstract \u5173\u952e\u5b57\u8fdb\u884c\u4fee\u9970\u3002\u5982\u679c\u4e00\u4e2a\u7c7b\u542b\u6709\u62bd\u8c61\u65b9\u6cd5\uff0c\u5219\u79f0\u8fd9\u4e2a\u7c7b\u4e3a\u62bd\u8c61\u7c7b\uff0c\u62bd\u8c61\u7c7b\u5fc5\u987b\u5728\u7c7b\u524d\u7528 abstract \u5173\u952e\u5b57\u4fee\u9970\u3002\u56e0\u4e3a\u62bd\u8c61\u7c7b\u4e2d\u542b\u6709\u65e0\u5177\u4f53\u5b9e\u73b0\u7684\u65b9\u6cd5\uff0c\u6240\u4ee5\u4e0d\u80fd\u7528\u62bd\u8c61\u7c7b\u521b\u5efa\u5bf9\u8c61\u3002<\/p>\n
\u4e0b\u9762\u8981\u6ce8\u610f\u4e00\u4e2a\u95ee\u9898\uff1a\u5728\u300aJAVA \u7f16\u7a0b\u601d\u60f3\u300b\u4e00\u4e66\u4e2d\uff0c\u5c06\u62bd\u8c61\u7c7b\u5b9a\u4e49\u4e3a\"\u5305\u542b\u62bd\u8c61\u65b9\u6cd5\u7684\u7c7b\"\uff0c\u4f46\u662f\u540e\u9762\u53d1\u73b0\u5982\u679c\u4e00\u4e2a\u7c7b\u4e0d\u5305\u542b\u62bd\u8c61\u65b9\u6cd5\uff0c\u53ea\u662f\u7528 abstract \u4fee\u9970\u7684\u8bdd\u4e5f\u662f\u62bd\u8c61\u7c7b\u3002\u4e5f\u5c31\u662f\u8bf4\u62bd\u8c61\u7c7b\u4e0d\u4e00\u5b9a\u5fc5\u987b\u542b\u6709\u62bd\u8c61\u65b9\u6cd5\u3002\u4e2a\u4eba\u89c9\u5f97\u8fd9\u4e2a\u5c5e\u4e8e\u94bb\u725b\u89d2\u5c16\u7684\u95ee\u9898\u5427\uff0c\u56e0\u4e3a\u5982\u679c\u4e00\u4e2a\u62bd\u8c61\u7c7b\u4e0d\u5305\u542b\u4efb\u4f55\u62bd\u8c61\u65b9\u6cd5\uff0c\u4e3a\u4f55\u8fd8\u8981\u8bbe\u8ba1\u4e3a\u62bd\u8c61\u7c7b\uff1f\u6240\u4ee5\u6682\u4e14\u8bb0\u4f4f\u8fd9\u4e2a\u6982\u5ff5\u5427\uff0c\u4e0d\u5fc5\u53bb\u6df1\u7a76\u4e3a\u4ec0\u4e48\u3002<\/p>\n
[public] abstract class ClassName {\r\n abstract void fun();\r\n}<\/pre>\n\u4ece\u8fd9\u91cc\u53ef\u4ee5\u770b\u51fa\uff0c\u62bd\u8c61\u7c7b\u5c31\u662f\u4e3a\u4e86\u7ee7\u627f\u800c\u5b58\u5728\u7684\uff0c\u5982\u679c\u4f60\u5b9a\u4e49\u4e86\u4e00\u4e2a\u62bd\u8c61\u7c7b\uff0c\u5374\u4e0d\u53bb\u7ee7\u627f\u5b83\uff0c\u90a3\u4e48\u7b49\u4e8e\u767d\u767d\u521b\u5efa\u4e86\u8fd9\u4e2a\u62bd\u8c61\u7c7b\uff0c\u56e0\u4e3a\u4f60\u4e0d\u80fd\u7528\u5b83\u6765\u505a\u4efb\u4f55\u4e8b\u60c5\u3002\u5bf9\u4e8e\u4e00\u4e2a\u7236\u7c7b\uff0c\u5982\u679c\u5b83\u7684\u67d0\u4e2a\u65b9\u6cd5\u5728\u7236\u7c7b\u4e2d\u5b9e\u73b0\u51fa\u6765\u6ca1\u6709\u4efb\u4f55\u610f\u4e49\uff0c\u5fc5\u987b\u6839\u636e\u5b50\u7c7b\u7684\u5b9e\u9645\u9700\u6c42\u6765\u8fdb\u884c\u4e0d\u540c\u7684\u5b9e\u73b0\uff0c\u90a3\u4e48\u5c31\u53ef\u4ee5\u5c06\u8fd9\u4e2a\u65b9\u6cd5\u58f0\u660e\u4e3a abstract \u65b9\u6cd5\uff0c\u6b64\u65f6\u8fd9\u4e2a\u7c7b\u4e5f\u5c31\u6210\u4e3a abstract \u7c7b\u4e86\u3002<\/p>\n
\u5305\u542b\u62bd\u8c61\u65b9\u6cd5\u7684\u7c7b\u79f0\u4e3a\u62bd\u8c61\u7c7b\uff0c\u4f46\u5e76\u4e0d\u610f\u5473\u7740\u62bd\u8c61\u7c7b\u4e2d\u53ea\u80fd\u6709\u62bd\u8c61\u65b9\u6cd5\uff0c\u5b83\u548c\u666e\u901a\u7c7b\u4e00\u6837\uff0c\u540c\u6837\u53ef\u4ee5\u62e5\u6709\u6210\u5458\u53d8\u91cf\u548c\u666e\u901a\u7684\u6210\u5458\u65b9\u6cd5\u3002\u6ce8\u610f\uff0c\u62bd\u8c61\u7c7b\u548c\u666e\u901a\u7c7b\u7684\u4e3b\u8981\u6709\u4e09\u70b9\u533a\u522b\uff1a<\/p>\n
\n- \u62bd\u8c61\u65b9\u6cd5\u5fc5\u987b\u4e3a public \u6216\u8005 protected\uff08\u56e0\u4e3a\u5982\u679c\u4e3a private\uff0c\u5219\u4e0d\u80fd\u88ab\u5b50\u7c7b\u7ee7\u627f\uff0c\u5b50\u7c7b\u4fbf\u65e0\u6cd5\u5b9e\u73b0\u8be5\u65b9\u6cd5\uff09\uff0c\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u9ed8\u8ba4\u4e3a public\u3002<\/li>\n
- \u62bd\u8c61\u7c7b\u4e0d\u80fd\u7528\u6765\u521b\u5efa\u5bf9\u8c61\uff1b<\/li>\n
- \u5982\u679c\u4e00\u4e2a\u7c7b\u7ee7\u627f\u4e8e\u4e00\u4e2a\u62bd\u8c61\u7c7b\uff0c\u5219\u5b50\u7c7b\u5fc5\u987b\u5b9e\u73b0\u7236\u7c7b\u7684\u62bd\u8c61\u65b9\u6cd5\u3002\u5982\u679c\u5b50\u7c7b\u6ca1\u6709\u5b9e\u73b0\u7236\u7c7b\u7684\u62bd\u8c61\u65b9\u6cd5\uff0c\u5219\u5fc5\u987b\u5c06\u5b50\u7c7b\u4e5f\u5b9a\u4e49\u4e3a\u4e3a abstract \u7c7b\u3002<\/li>\n
\u5728\u5176\u4ed6\u65b9\u9762\uff0c\u62bd\u8c61\u7c7b\u548c\u666e\u901a\u7684\u7c7b\u5e76\u6ca1\u6709\u533a\u522b\u3002<\/ol>\n
\u4e8c\u3001\u63a5\u53e3<\/strong><\/div>\n\u63a5\u53e3\uff0c\u82f1\u6587\u79f0\u4f5c interface\uff0c\u5728\u8f6f\u4ef6\u5de5\u7a0b\u4e2d\uff0c\u63a5\u53e3\u6cdb\u6307\u4f9b\u522b\u4eba\u8c03\u7528\u7684\u65b9\u6cd5\u6216\u8005\u51fd\u6570\u3002\u4ece\u8fd9\u91cc\uff0c\u6211\u4eec\u53ef\u4ee5\u4f53\u4f1a\u5230 Java \u8bed\u8a00\u8bbe\u8ba1\u8005\u7684\u521d\u8877\uff0c\u5b83\u662f\u5bf9\u884c\u4e3a\u7684\u62bd\u8c61\u3002\u5728 Java \u4e2d\uff0c\u5b9a\u4e00\u4e2a\u63a5\u53e3\u7684\u5f62\u5f0f\u5982\u4e0b\uff1a<\/p>\n
[public] interface InterfaceName {\r\n \r\n}<\/pre>\n\u63a5\u53e3\u4e2d\u53ef\u4ee5\u542b\u6709 \u53d8\u91cf\u548c\u65b9\u6cd5\u3002\u4f46\u662f\u8981\u6ce8\u610f\uff0c\u63a5\u53e3\u4e2d\u7684\u53d8\u91cf\u4f1a\u88ab\u9690\u5f0f\u5730\u6307\u5b9a\u4e3a public static final \u53d8\u91cf\uff08\u5e76\u4e14\u53ea\u80fd\u662f public static final\u53d8\u91cf\uff0c\u7528 private \u4fee\u9970\u4f1a\u62a5\u7f16\u8bd1\u9519\u8bef\uff09\uff0c\u800c\u65b9\u6cd5\u4f1a\u88ab\u9690\u5f0f\u5730\u6307\u5b9a\u4e3a public abstract \u65b9\u6cd5\u4e14\u53ea\u80fd\u662f public abstract \u65b9\u6cd5\uff08\u7528\u5176\u4ed6\u5173\u952e\u5b57\uff0c\u6bd4\u5982 private\u3001protected\u3001static\u3001 final \u7b49\u4fee\u9970\u4f1a\u62a5\u7f16\u8bd1\u9519\u8bef\uff09\uff0c\u5e76\u4e14\u63a5\u53e3\u4e2d\u6240\u6709\u7684\u65b9\u6cd5\u4e0d\u80fd\u6709\u5177\u4f53\u7684\u5b9e\u73b0\uff0c\u4e5f\u5c31\u662f\u8bf4\uff0c\u63a5\u53e3\u4e2d\u7684\u65b9\u6cd5\u5fc5\u987b\u90fd\u662f\u62bd\u8c61\u65b9\u6cd5\u3002\u4ece\u8fd9\u91cc\u53ef\u4ee5\u9690\u7ea6\u770b\u51fa\u63a5\u53e3\u548c\u62bd\u8c61\u7c7b\u7684\u533a\u522b\uff0c\u63a5\u53e3\u662f\u4e00\u79cd\u6781\u5ea6\u62bd\u8c61\u7684\u7c7b\u578b\uff0c\u5b83\u6bd4\u62bd\u8c61\u7c7b\u66f4\u52a0\"\u62bd\u8c61\"\uff0c\u5e76\u4e14\u4e00\u822c\u60c5\u51b5\u4e0b\u4e0d\u5728\u63a5\u53e3\u4e2d\u5b9a\u4e49\u53d8\u91cf\u3002<\/p>\n
\u8981\u8ba9\u4e00\u4e2a\u7c7b\u9075\u5faa\u67d0\u7ec4\u7279\u5730\u7684\u63a5\u53e3\u9700\u8981\u4f7f\u7528 implements \u5173\u952e\u5b57\uff0c\u5177\u4f53\u683c\u5f0f\u5982\u4e0b\uff1a<\/p>\n
class ClassName implements Interface1,Interface2,[....]{\r\n}<\/pre>\n\u53ef\u4ee5\u770b\u51fa\uff0c\u5141\u8bb8\u4e00\u4e2a\u7c7b\u9075\u5faa\u591a\u4e2a\u7279\u5b9a\u7684\u63a5\u53e3\u3002\u5982\u679c\u4e00\u4e2a\u975e\u62bd\u8c61\u7c7b\u9075\u5faa\u4e86\u67d0\u4e2a\u63a5\u53e3\uff0c\u5c31\u5fc5\u987b\u5b9e\u73b0\u8be5\u63a5\u53e3\u4e2d\u7684\u6240\u6709\u65b9\u6cd5\u3002\u5bf9\u4e8e\u9075\u5faa\u67d0\u4e2a\u63a5\u53e3\u7684\u62bd\u8c61\u7c7b\uff0c\u53ef\u4ee5\u4e0d\u5b9e\u73b0\u8be5\u63a5\u53e3\u4e2d\u7684\u62bd\u8c61\u65b9\u6cd5\u3002<\/p>\n
\u62bd\u8c61\u7c7b\u548c\u63a5\u53e3\u7684\u533a\u522b<\/strong><\/div>\n1\u3001\u8bed\u6cd5\u5c42\u9762\u4e0a\u7684\u533a\u522b<\/strong><\/span><\/div>\n\n- \u62bd\u8c61\u7c7b\u53ef\u4ee5\u63d0\u4f9b\u6210\u5458\u65b9\u6cd5\u7684\u5b9e\u73b0\u7ec6\u8282\uff0c\u800c\u63a5\u53e3\u4e2d\u53ea\u80fd\u5b58\u5728public abstract \u65b9\u6cd5\uff1b<\/li>\n
- \u62bd\u8c61\u7c7b\u4e2d\u7684\u6210\u5458\u53d8\u91cf\u53ef\u4ee5\u662f\u5404\u79cd\u7c7b\u578b\u7684\uff0c\u800c\u63a5\u53e3\u4e2d\u7684\u6210\u5458\u53d8\u91cf\u53ea\u80fd\u662fpublic static final\u7c7b\u578b\u7684\uff1b<\/li>\n
- \u63a5\u53e3\u4e2d\u4e0d\u80fd\u542b\u6709\u9759\u6001\u4ee3\u7801\u5757\u4ee5\u53ca\u9759\u6001\u65b9\u6cd5\uff0c\u800c\u62bd\u8c61\u7c7b\u53ef\u4ee5\u6709\u9759\u6001\u4ee3\u7801\u5757\u548c\u9759\u6001\u65b9\u6cd5\uff1b<\/li>\n
- \u4e00\u4e2a\u7c7b\u53ea\u80fd\u7ee7\u627f\u4e00\u4e2a\u62bd\u8c61\u7c7b\uff0c\u800c\u4e00\u4e2a\u7c7b\u5374\u53ef\u4ee5\u5b9e\u73b0\u591a\u4e2a\u63a5\u53e3\u3002<\/li>\n<\/ol>\n
2\u3001\u8bbe\u8ba1\u5c42\u9762\u4e0a\u7684\u533a\u522b<\/strong><\/span><\/div>\n\n- \u62bd\u8c61\u7c7b\u662f\u5bf9\u4e00\u79cd\u4e8b\u7269\u7684\u62bd\u8c61\uff0c\u5373\u5bf9\u7c7b\u62bd\u8c61\uff0c\u800c\u63a5\u53e3\u662f\u5bf9\u884c\u4e3a\u7684\u62bd\u8c61\u3002\u62bd\u8c61\u7c7b\u662f\u5bf9\u6574\u4e2a\u7c7b\u6574\u4f53\u8fdb\u884c\u62bd\u8c61\uff0c\u5305\u62ec\u5c5e\u6027\u3001\u884c\u4e3a\uff0c\u4f46\u662f\u63a5\u53e3\u5374\u662f\u5bf9\u7c7b\u5c40\u90e8\uff08\u884c\u4e3a\uff09\u8fdb\u884c\u62bd\u8c61\u3002\u4e3e\u4e2a\u7b80\u5355\u7684\u4f8b\u5b50\uff0c\u98de\u673a\u548c\u9e1f\u662f\u4e0d\u540c\u7c7b\u7684\u4e8b\u7269\uff0c\u4f46\u662f\u5b83\u4eec\u90fd\u6709\u4e00\u4e2a\u5171\u6027\uff0c\u5c31\u662f\u90fd\u4f1a\u98de\u3002\u90a3\u4e48\u5728\u8bbe\u8ba1\u7684\u65f6\u5019\uff0c\u53ef\u4ee5\u5c06\u98de\u673a\u8bbe\u8ba1\u4e3a\u4e00\u4e2a\u7c7b Airplane\uff0c\u5c06\u9e1f\u8bbe\u8ba1\u4e3a\u4e00\u4e2a\u7c7b Bird\uff0c\u4f46\u662f\u4e0d\u80fd\u5c06 \u98de\u884c \u8fd9\u4e2a\u7279\u6027\u4e5f\u8bbe\u8ba1\u4e3a\u7c7b\uff0c\u56e0\u6b64\u5b83\u53ea\u662f\u4e00\u4e2a\u884c\u4e3a\u7279\u6027\uff0c\u5e76\u4e0d\u662f\u5bf9\u4e00\u7c7b\u4e8b\u7269\u7684\u62bd\u8c61\u63cf\u8ff0\u3002\u6b64\u65f6\u53ef\u4ee5\u5c06 \u98de\u884c \u8bbe\u8ba1\u4e3a\u4e00\u4e2a\u63a5\u53e3Fly\uff0c\u5305\u542b\u65b9\u6cd5fly( )\uff0c\u7136\u540eAirplane\u548cBird\u5206\u522b\u6839\u636e\u81ea\u5df1\u7684\u9700\u8981\u5b9e\u73b0Fly\u8fd9\u4e2a\u63a5\u53e3\u3002\u7136\u540e\u81f3\u4e8e\u6709\u4e0d\u540c\u79cd\u7c7b\u7684\u98de\u673a\uff0c\u6bd4\u5982\u6218\u6597\u673a\u3001\u6c11\u7528\u98de\u673a\u7b49\u76f4\u63a5\u7ee7\u627fAirplane\u5373\u53ef\uff0c\u5bf9\u4e8e\u9e1f\u4e5f\u662f\u7c7b\u4f3c\u7684\uff0c\u4e0d\u540c\u79cd\u7c7b\u7684\u9e1f\u76f4\u63a5\u7ee7\u627fBird\u7c7b\u5373\u53ef\u3002\u4ece\u8fd9\u91cc\u53ef\u4ee5\u770b\u51fa\uff0c\u7ee7\u627f\u662f\u4e00\u4e2a \"\u662f\u4e0d\u662f\"\u7684\u5173\u7cfb\uff0c\u800c \u63a5\u53e3 \u5b9e\u73b0\u5219\u662f \"\u6709\u6ca1\u6709\"\u7684\u5173\u7cfb\u3002\u5982\u679c\u4e00\u4e2a\u7c7b\u7ee7\u627f\u4e86\u67d0\u4e2a\u62bd\u8c61\u7c7b\uff0c\u5219\u5b50\u7c7b\u5fc5\u5b9a\u662f\u62bd\u8c61\u7c7b\u7684\u79cd\u7c7b\uff0c\u800c\u63a5\u53e3\u5b9e\u73b0\u5219\u662f\u6709\u6ca1\u6709\u3001\u5177\u5907\u4e0d\u5177\u5907\u7684\u5173\u7cfb\uff0c\u6bd4\u5982\u9e1f\u662f\u5426\u80fd\u98de\uff08\u6216\u8005\u662f\u5426\u5177\u5907\u98de\u884c\u8fd9\u4e2a\u7279\u70b9\uff09\uff0c\u80fd\u98de\u884c\u5219\u53ef\u4ee5\u5b9e\u73b0\u8fd9\u4e2a\u63a5\u53e3\uff0c\u4e0d\u80fd\u98de\u884c\u5c31\u4e0d\u5b9e\u73b0\u8fd9\u4e2a\u63a5\u53e3\u3002<\/li>\n
- \u8bbe\u8ba1\u5c42\u9762\u4e0d\u540c\uff0c\u62bd\u8c61\u7c7b\u4f5c\u4e3a\u5f88\u591a\u5b50\u7c7b\u7684\u7236\u7c7b\uff0c\u5b83\u662f\u4e00\u79cd\u6a21\u677f\u5f0f\u8bbe\u8ba1\u3002\u800c\u63a5\u53e3\u662f\u4e00\u79cd\u884c\u4e3a\u89c4\u8303\uff0c\u5b83\u662f\u4e00\u79cd\u8f90\u5c04\u5f0f\u8bbe\u8ba1\u3002\u4ec0\u4e48\u662f\u6a21\u677f\u5f0f\u8bbe\u8ba1\uff1f\u6700\u7b80\u5355\u4f8b\u5b50\uff0c\u5927\u5bb6\u90fd\u7528\u8fc7 ppt \u91cc\u9762\u7684\u6a21\u677f\uff0c\u5982\u679c\u7528\u6a21\u677f A \u8bbe\u8ba1\u4e86 ppt B \u548c ppt C\uff0cppt B \u548c ppt C \u516c\u5171\u7684\u90e8\u5206\u5c31\u662f\u6a21\u677f A \u4e86\uff0c\u5982\u679c\u5b83\u4eec\u7684\u516c\u5171\u90e8\u5206\u9700\u8981\u6539\u52a8\uff0c\u5219\u53ea\u9700\u8981\u6539\u52a8\u6a21\u677f A \u5c31\u53ef\u4ee5\u4e86\uff0c\u4e0d\u9700\u8981\u91cd\u65b0\u5bf9 ppt B \u548c ppt C \u8fdb\u884c\u6539\u52a8\u3002\u800c\u8f90\u5c04\u5f0f\u8bbe\u8ba1\uff0c\u6bd4\u5982\u67d0\u4e2a\u7535\u68af\u90fd\u88c5\u4e86\u67d0\u79cd\u62a5\u8b66\u5668\uff0c\u4e00\u65e6\u8981\u66f4\u65b0\u62a5\u8b66\u5668\uff0c\u5c31\u5fc5\u987b\u5168\u90e8\u66f4\u65b0\u3002\u4e5f\u5c31\u662f\u8bf4\u5bf9\u4e8e\u62bd\u8c61\u7c7b\uff0c\u5982\u679c\u9700\u8981\u6dfb\u52a0\u65b0\u7684\u65b9\u6cd5\uff0c\u53ef\u4ee5\u76f4\u63a5\u5728\u62bd\u8c61\u7c7b\u4e2d\u6dfb\u52a0\u5177\u4f53\u7684\u5b9e\u73b0\uff0c\u5b50\u7c7b\u53ef\u4ee5\u4e0d\u8fdb\u884c\u53d8\u66f4\uff1b\u800c\u5bf9\u4e8e\u63a5\u53e3\u5219\u4e0d\u884c\uff0c\u5982\u679c\u63a5\u53e3\u8fdb\u884c\u4e86\u53d8\u66f4\uff0c\u5219\u6240\u6709\u5b9e\u73b0\u8fd9\u4e2a\u63a5\u53e3\u7684\u7c7b\u90fd\u5fc5\u987b\u8fdb\u884c\u76f8\u5e94\u7684\u6539\u52a8\u3002<\/li>\n<\/ol>\n
\u4e0b\u9762\u770b\u4e00\u4e2a\u7f51\u4e0a\u6d41\u4f20\u6700\u5e7f\u6cdb\u7684\u4f8b\u5b50\uff1a\u95e8\u548c\u8b66\u62a5\u7684\u4f8b\u5b50\uff1a\u95e8\u90fd\u6709 open() \u548c close() \u4e24\u4e2a\u52a8\u4f5c\uff0c\u6b64\u65f6\u6211\u4eec\u53ef\u4ee5\u5b9a\u4e49\u901a\u8fc7\u62bd\u8c61\u7c7b\u548c\u63a5\u53e3\u6765\u5b9a\u4e49\u8fd9\u4e2a\u62bd\u8c61\u6982\u5ff5\uff1a<\/p>\n
abstract class Door {\r\n public abstract void open();\r\n public abstract void close();\r\n}<\/pre>\n\u6216\u8005\uff1a<\/p>\n
interface Door {\r\n public abstract void open();\r\n public abstract void close();\r\n}<\/pre>\n\u4f46\u662f\u73b0\u5728\u5982\u679c\u6211\u4eec\u9700\u8981\u95e8\u5177\u6709\u62a5\u8b66 \u7684\u529f\u80fd\uff0c\u90a3\u4e48\u8be5\u5982\u4f55\u5b9e\u73b0\uff1f\u4e0b\u9762\u63d0\u4f9b\u4e24\u79cd\u601d\u8def\uff1a<\/p>\n
\n- \u5c06\u8fd9\u4e09\u4e2a\u529f\u80fd\u90fd\u653e\u5728\u62bd\u8c61\u7c7b\u91cc\u9762\uff0c\u4f46\u662f\u8fd9\u6837\u4e00\u6765\u6240\u6709\u7ee7\u627f\u4e8e\u8fd9\u4e2a\u62bd\u8c61\u7c7b\u7684\u5b50\u7c7b\u90fd\u5177\u5907\u4e86\u62a5\u8b66\u529f\u80fd\uff0c\u4f46\u662f\u6709\u7684\u95e8\u5e76\u4e0d\u4e00\u5b9a\u5177\u5907\u62a5\u8b66\u529f\u80fd\uff1b<\/li>\n
- \u5c06\u8fd9\u4e09\u4e2a\u529f\u80fd\u90fd\u653e\u5728\u63a5\u53e3\u91cc\u9762\uff0c\u9700\u8981\u7528\u5230\u62a5\u8b66\u529f\u80fd\u7684\u7c7b\u5c31\u9700\u8981\u5b9e\u73b0\u8fd9\u4e2a\u63a5\u53e3\u4e2d\u7684 open( ) \u548c close( )\uff0c\u4e5f\u8bb8\u8fd9\u4e2a\u7c7b\u6839\u672c\u5c31\u4e0d\u5177\u5907 open( ) \u548c close( ) \u8fd9\u4e24\u4e2a\u529f\u80fd\uff0c\u6bd4\u5982\u706b\u707e\u62a5\u8b66\u5668\u3002<\/li>\n<\/ol>\n
\u4ece\u8fd9\u91cc\u53ef\u4ee5\u770b\u51fa\uff0c Door \u7684 open() \u3001close() \u548c alarm() \u6839\u672c\u5c31\u5c5e\u4e8e\u4e24\u4e2a\u4e0d\u540c\u8303\u7574\u5185\u7684\u884c\u4e3a\uff0copen() \u548c close() \u5c5e\u4e8e\u95e8\u672c\u8eab\u56fa\u6709\u7684\u884c\u4e3a\u7279\u6027\uff0c\u800c alarm() \u5c5e\u4e8e\u5ef6\u4f38\u7684\u9644\u52a0\u884c\u4e3a\u3002\u56e0\u6b64\u6700\u597d\u7684\u89e3\u51b3\u529e\u6cd5\u662f\u5355\u72ec\u5c06\u62a5\u8b66\u8bbe\u8ba1\u4e3a\u4e00\u4e2a\u63a5\u53e3\uff0c\u5305\u542b alarm() \u884c\u4e3a\uff0cDoor \u8bbe\u8ba1\u4e3a\u5355\u72ec\u7684\u4e00\u4e2a\u62bd\u8c61\u7c7b\uff0c\u5305\u542b open \u548c close \u4e24\u79cd\u884c\u4e3a\u3002\u518d\u8bbe\u8ba1\u4e00\u4e2a\u62a5\u8b66\u95e8\u7ee7\u627f Door \u7c7b\u548c\u5b9e\u73b0 Alarm \u63a5\u53e3\u3002<\/p>\n
interface Alram {\r\n void alarm();\r\n}\r\n \r\nabstract class Door {\r\n void open();\r\n void close();\r\n}\r\n \r\nclass AlarmDoor extends Door implements Alarm {\r\n void oepn() {\r\n \/\/....\r\n }\r\n void close() {\r\n \/\/....\r\n }\r\n void alarm() {\r\n \/\/....\r\n }\r\n}<\/pre>\n","protected":false},"excerpt":{"rendered":"\u5728\u4e86\u89e3\u62bd\u8c61\u7c7b\u4e4b\u524d\uff0c\u5148\u6765\u4e86\u89e3\u4e00\u4e0b\u62bd\u8c61\u65b9\u6cd5\u3002\u62bd\u8c61\u65b9\u6cd5\u662f\u4e00\u79cd\u7279\u6b8a\u7684\u65b9\u6cd5\uff1a\u5b83\u53ea\u6709\u58f0\u660e\uff0c\u800c\u6ca1\u6709\u5177\u4f53\u7684\u5b9e\u73b0\u3002\u62bd\u8c61\u65b9\u6cd5\u7684\u58f0\u660e […]<\/p>\n","protected":false},"author":1470,"featured_media":191135,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-191129","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/191129","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/1470"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=191129"}],"version-history":[{"count":5,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/191129\/revisions"}],"predecessor-version":[{"id":191147,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/191129\/revisions\/191147"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/191135"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=191129"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=191129"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=191129"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}