{"id":1402,"date":"2023-05-16T13:57:48","date_gmt":"2023-05-16T05:57:48","guid":{"rendered":"https:\/\/sanlangcode.com\/?p=1402"},"modified":"2023-05-16T13:57:48","modified_gmt":"2023-05-16T05:57:48","slug":"c%e8%99%9a%e5%87%bd%e6%95%b0%e4%b8%8ejava%e6%8a%bd%e8%b1%a1%e7%b1%bb%e3%80%81%e6%8a%bd%e8%b1%a1%e6%96%b9%e6%b3%95%e7%9a%84%e6%af%94%e8%be%83","status":"publish","type":"post","link":"https:\/\/sanlangcode.com\/index.php\/2023\/05\/16\/c%e8%99%9a%e5%87%bd%e6%95%b0%e4%b8%8ejava%e6%8a%bd%e8%b1%a1%e7%b1%bb%e3%80%81%e6%8a%bd%e8%b1%a1%e6%96%b9%e6%b3%95%e7%9a%84%e6%af%94%e8%be%83\/","title":{"rendered":"c++\u865a\u51fd\u6570\u4e0eJava\u62bd\u8c61\u7c7b\u3001\u62bd\u8c61\u65b9\u6cd5\u7684\u6bd4\u8f83"},"content":{"rendered":"\n<p>1.<strong>\u865a\u51fd\u6570<\/strong><\/p>\n\n\n\n<p>\u865a\u51fd\u6570\u7684\u5b58\u5728\u662f\u4e3a\u4e86\u591a\u6001\u3002<\/p>\n\n\n\n<p>C++\u4e2d\u666e\u901a\u6210\u5458\u51fd\u6570\u52a0\u4e0avirtual\u5173\u952e\u5b57\u5c31\u6210\u4e3a\u865a\u51fd\u6570<\/p>\n\n\n\n<p>Java\u4e2d\u5176\u5b9e\u6ca1\u6709\u865a\u51fd\u6570\u7684\u6982\u5ff5\uff0c\u5b83\u7684\u666e\u901a\u51fd\u6570\u5c31\u76f8\u5f53\u4e8eC++\u7684\u865a\u51fd\u6570\uff0c\u52a8\u6001\u7ed1\u5b9a\u662fJava\u7684\u9ed8\u8ba4\u884c\u4e3a\u3002<\/p>\n\n\n\n<p>\u5982\u679cJava\u4e2d\u4e0d\u5e0c\u671b\u67d0\u4e2a\u51fd\u6570\u5177\u6709\u865a\u51fd\u6570\u7279\u6027\uff0c\u53ef\u4ee5\u52a0\u4e0afinal\u5173\u952e\u5b57\u53d8\u6210\u975e\u865a\u51fd\u6570\u3002<\/p>\n\n\n\n<p><strong>2.\u62bd\u8c61\u51fd\u6570(\u7eaf\u865a\u51fd\u6570)<\/strong><\/p>\n\n\n\n<p>\u62bd\u8c61\u51fd\u6570\u6216\u8005\u8bf4\u662f\u7eaf\u865a\u51fd\u6570\u7684\u5b58\u5728\u662f\u4e3a\u4e86\u5b9a\u4e49\u63a5\u53e3\u3002<\/p>\n\n\n\n<p>C++\u4e2d\u7eaf\u865a\u51fd\u6570\u5f62\u5f0f\u4e3a\uff1avirtual void print()=0;<\/p>\n\n\n\n<p>Java\u4e2d\u7eaf\u865a\u51fd\u6570\u5f62\u5f0f\u4e3a\uff1aabstract void print();<\/p>\n\n\n\n<p><strong>3.\u62bd\u8c61\u7c7b<\/strong><\/p>\n\n\n\n<p>\u62bd\u8c61\u7c7b\u7684\u5b58\u5728\u662f\u56e0\u4e3a\u7236\u7c7b\u4e2d\u65e2\u5305\u62ec\u5b50\u7c7b\u5171\u6027\u51fd\u6570\u7684\u5177\u4f53\u5b9a\u4e49\uff0c\u4e5f\u5305\u62ec\u9700\u8981\u5b50\u7c7b\u5404\u81ea\u5b9e\u73b0\u7684\u51fd\u6570\u63a5\u53e3\u3002<\/p>\n\n\n\n<p>\u62bd\u8c61\u7c7b\u4e2d\u53ef\u4ee5\u6709\u6570\u636e\u6210\u5458\u548c\u975e\u62bd\u8c61\u65b9\u6cd5\u3002C++\u4e2d\u62bd\u8c61\u7c7b\u53ea\u9700\u8981\u5305\u62ec\u7eaf\u865a\u51fd\u6570\uff0c\u65e2\u662f\u4e00\u4e2a\u62bd\u8c61\u7c7b\u3002\u5982\u679c\u4ec5\u4ec5\u5305\u62ec\u865a\u51fd\u6570\uff0c\u4e0d\u80fd\u5b9a\u4e49\u4e3a\u62bd\u8c61\u7c7b\uff0c\u56e0\u4e3a\u7c7b\u4e2d\u5176\u5b9e\u6ca1\u6709\u62bd\u8c61\u7684\u6982\u5ff5\u3002Java\u62bd\u8c61\u7c7b\u662f\u7528abstract\u4fee\u9970\u58f0\u660e\u7684\u7c7b\u3002<\/p>\n\n\n\n<p>\u62bd\u8c61\u7c7b\u5176\u5b9e\u662f\u4e00\u4e2a\u534a\u865a\u534a\u5b9e\u7684\u4e1c\u897f\uff0c\u53ef\u4ee5\u5168\u90e8\u4e3a\u865a\uff0c\u8fd9\u65f6\u5019\u53d8\u6210\u63a5\u53e3\u3002<\/p>\n\n\n\n<p><strong>4.\u63a5\u53e3<\/strong><\/p>\n\n\n\n<p>\u63a5\u53e3\u7684\u5b58\u5728\u662f\u4e3a\u4e86\u5f62\u6210\u4e00\u79cd\u89c4\u7ea6\u3002\u63a5\u53e3\u4e2d\u4e0d\u80fd\u6709\u666e\u901a\u6210\u5458\u53d8\u91cf\uff0c\u4e5f\u4e0d\u80fd\u5177\u6709\u975e\u7eaf\u865a\u51fd\u6570\u3002<\/p>\n\n\n\n<p>C++\u4e2d\u63a5\u53e3\u5176\u5b9e\u5c31\u662f\u5168\u865a\u57fa\u7c7b\u3002Java\u4e2d\u63a5\u53e3\u662f\u7528interface\u4fee\u9970\u7684\u7c7b\u3002<\/p>\n\n\n\n<p>PS\uff1a\u63a5\u53e3\u5c31\u662f\u865a\u5230\u6781\u70b9\u7684\u62bd\u8c61\u7c7b\u3002<\/p>\n\n\n\n<p><strong>5.\u5c0f\u7ed3<\/strong><\/p>\n\n\n\n<p>C++\u865a\u51fd\u6570==Java\u666e\u901a\u51fd\u6570<\/p>\n\n\n\n<p>C++\u7eaf\u865a\u51fd\u6570==Java\u62bd\u8c61\u51fd\u6570<\/p>\n\n\n\n<p>C++\u62bd\u8c61\u7c7b==Java\u62bd\u8c61\u7c7b<\/p>\n\n\n\n<p>C++\u865a\u57fa\u7c7b==Java\u63a5\u53e3<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1.\u865a\u51fd\u6570 \u865a\u51fd\u6570\u7684\u5b58\u5728\u662f\u4e3a\u4e86\u591a&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":1403,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[30],"class_list":["post-1402","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-4","tag-c"],"_links":{"self":[{"href":"https:\/\/sanlangcode.com\/index.php\/wp-json\/wp\/v2\/posts\/1402","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sanlangcode.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sanlangcode.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sanlangcode.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sanlangcode.com\/index.php\/wp-json\/wp\/v2\/comments?post=1402"}],"version-history":[{"count":0,"href":"https:\/\/sanlangcode.com\/index.php\/wp-json\/wp\/v2\/posts\/1402\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/sanlangcode.com\/index.php\/wp-json\/"}],"wp:attachment":[{"href":"https:\/\/sanlangcode.com\/index.php\/wp-json\/wp\/v2\/media?parent=1402"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sanlangcode.com\/index.php\/wp-json\/wp\/v2\/categories?post=1402"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sanlangcode.com\/index.php\/wp-json\/wp\/v2\/tags?post=1402"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}