{"id":295,"date":"2016-03-31T15:05:49","date_gmt":"2016-03-31T07:05:49","guid":{"rendered":"http:\/\/blog.droidking.com\/?p=295"},"modified":"2016-03-31T16:14:26","modified_gmt":"2016-03-31T08:14:26","slug":"c%e4%b8%ad%e7%9a%84%e6%8a%bd%e8%b1%a1%e5%9f%ba%e7%b1%bb%e5%92%8c%e6%8e%a5%e5%8f%a3","status":"publish","type":"post","link":"http:\/\/droidking.com\/?p=295","title":{"rendered":"C#\u4e2d\u7684\u62bd\u8c61\u57fa\u7c7b\uff08Abstract Base Class\uff09\u548c\u63a5\u53e3\uff08Interface\uff09"},"content":{"rendered":"<p>\u62bd\u8c61\u57fa\u7c7b\u548c\u63a5\u53e3\u6709\u5f88\u591a\u7c7b\u4f3c\u7684\u5730\u65b9\uff0c\u90a3\u4e48\u6211\u4eec\u5728\u8f6f\u4ef6\u67b6\u6784\u7684\u8fc7\u7a0b\u4e2d\u5982\u4f55\u51b3\u5b9a\u8be5\u7528\u62bd\u8c61\u57fa\u7c7b\u8fd8\u662f\u63a5\u53e3\u5462\uff1fStack Overfollow\u4e0a\u6709\u4e00\u4e2a\u56de\u7b54\u603b\u7ed3\u5f97\u6bd4\u8f83\u597d\uff0c\u867d\u7136\u53ea\u6709\u77ed\u77ed\u51e0\u5341\u4e2a\u5b57\uff1a<\/p>\n<pre>Abstract classes and interfaces are semantically different, although their usage can overlap.\r\n\r\nAn abstract class is generally used as a building basis for similar classes. Implementation that is common for the classes can be in the abstract class.\r\n\r\nAn interface is generally used to specify an ability for classes, where the classes doesn't have to be very similar.<\/pre>\n<p>\u53ef\u4ee5\u8fd9\u4e48\u7406\u89e3\uff1a\u57fa\u7c7b\u662f\u7239\uff0c\u63a5\u53e3\u662f\u80fd\u529b\u3002\u7239\u53ea\u80fd\u6709\u4e00\u4e2a\uff0c\u800c\u4e14\u4ed6\u51b3\u5b9a\u4e86\u4f60\u662f\u4ec0\u4e48\uff0c\u4f46\u80fd\u529b\u53ef\u4ee5\u6709\u591a\u4e2a\u3002<\/p>\n<p><strong>\u5e94\u8be5\u8003\u8651\u4f7f\u7528\u62bd\u8c61\u57fa\u7c7b\u7684\u573a\u666f\uff1a<\/strong><\/p>\n<ul>\n<li style=\"padding-left: 30px;\">\u903b\u8f91\u4e0a\u662f\u540c\u4e00\u7c7b\u7684\u4e1c\u897f\uff08is a...\uff09\uff1b<\/li>\n<li style=\"padding-left: 30px;\">\u6709\u9700\u8981\u5b9e\u73b0\u7684\u516c\u5171\u65b9\u6cd5\u6216\u5c5e\u6027\uff1b<\/li>\n<li style=\"padding-left: 30px;\">\u9700\u8981\u5e8f\u5217\u5316\u7684\u6210\u5458\u7c7b\u578b\uff08\u56e0\u4e3a\u63a5\u53e3\u65e0\u6cd5\u5e8f\u5217\u5316\uff09\uff1b<\/li>\n<\/ul>\n<p class=\"bawpvc-ajax-counter\" data-id=\"295\">\u9605\u8bfb\uff1a147<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u62bd\u8c61\u57fa\u7c7b\u548c\u63a5\u53e3\u6709\u5f88\u591a\u7c7b\u4f3c\u7684\u5730\u65b9\uff0c\u90a3\u4e48\u6211\u4eec\u5728\u8f6f\u4ef6\u67b6\u6784\u7684\u8fc7\u7a0b\u4e2d\u5982\u4f55\u51b3\u5b9a\u8be5\u7528\u62bd\u8c61\u57fa\u7c7b\u8fd8\u662f\u63a5\u53e3\u5462\uff1fStack Over &hellip; <a href=\"http:\/\/droidking.com\/?p=295\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">C#\u4e2d\u7684\u62bd\u8c61\u57fa\u7c7b\uff08Abstract Base Class\uff09\u548c\u63a5\u53e3\uff08Interface\uff09<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[27,5],"tags":[],"class_list":["post-295","post","type-post","status-publish","format-standard","hentry","category-c","category-5"],"_links":{"self":[{"href":"http:\/\/droidking.com\/index.php?rest_route=\/wp\/v2\/posts\/295","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/droidking.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/droidking.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/droidking.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/droidking.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=295"}],"version-history":[{"count":4,"href":"http:\/\/droidking.com\/index.php?rest_route=\/wp\/v2\/posts\/295\/revisions"}],"predecessor-version":[{"id":299,"href":"http:\/\/droidking.com\/index.php?rest_route=\/wp\/v2\/posts\/295\/revisions\/299"}],"wp:attachment":[{"href":"http:\/\/droidking.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=295"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/droidking.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=295"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/droidking.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=295"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}