Đang tải dữ liệu...
Bảng so sánh Interface và Abstract Class - SinhViênIT.Net ||Diễn Đàn Sinh Viên CNTT
 
 
Đang tải...
 
       
Trở lại   SinhViênIT.Net ||Diễn Đàn Sinh Viên CNTT > Thế Giới Lập Trình Viên > Các ngôn ngữ nâng cao và .NET > Visual C#



Đang tải bộ máy tìm kiếm


Trả lời Gởi Ðề Tài Mới
Lần đọc: 346 - Trả lời: 0  
Ðiều Chỉnh
  #1  
Cũ 22-04-2010, 10:09 PM
tranthanhhao's Avatar
tranthanhhao tranthanhhao đã thoát
Thành Viên SVIT
Tên Thật: Trần Thanh Hào
Giới tính: Nam
Đang học trường: Học Viện CNTT Quốc Tế NIIT - Thăng Long
Đang học khoa: Lập Trình
Nghề Nghiệp: Sinh Viên
Cấp độ: 12 [SinhVienIT.NetSinhVienIT.NetSinhVienIT.Net]
Hoạt động: 0 / 291
Điểm: 61 / 1139
Kinh Nghiệm: 65%
Thành Viên Thứ: 14387
Tham gia ngày: 08-05-2009
Đến từ: Vĩnh Phúc
Tuổi: 19
Bài gửi: 185
Đã Cám ơn: 73 bài viết
Được cám ơn: 8 Lần trong 8 Bài viết
Gửi tin nhắn qua Yahoo! tới tranthanhhao
Mặc định Bảng so sánh Interface và Abstract Class

Bảng so sánh Interface và Abstract Class

Nguồn bài viết: http://sinhvienit.net/@forum/showthread.php?t=24456
[ TABLE="head"]Feature|Interface|Abstract class
Multiple inheritance|A class may inherit several interfaces.|A class may inherit only one abstract class.
Default implementation|An interface cannot provide any code, just the signature.|An abstract class can provide complete, default code and/or just the details that have to be overridden.
Access Modfiers|An interface cannot have access modifiers for the subs, functions, properties etc everything is assumed as public|An abstract class can contain access modifiers for the subs, functions, properties
Core VS Peripheral|Interfaces are used to define the peripheral abilities of a class. In other words both Human and Vehicle can inherit from a IMovable interface.|An abstract class defines the core identity of a class and there it is used for objects of the same type.
Homogeneity|If various implementations only share method signatures then it is better to use Interfaces.|If various implementations are of the same kind and use common behaviour or status then abstract class is better to use.
Speed|Requires more time to find the actual method in the corresponding classes.|Fast
Adding functionality (Versioning)|If we add a new method to an Interface then we have to track down all the implementations of the interface and define implementation for the new method.|If we add a new method to an abstract class then we have the option of providing default implementation and therefore all the existing code might work properly.
Fields and Constants|No fields can be defined in interfaces|An abstract class can have fields and constrants defined

[/TABLE]
http://mms0901niit.net
Diễn Đàn MMS 0901 NIIT - Thăng Long - Hà Nội
Trả Lời Với Trích Dẫn
Quảng cáo
Trả lời Gởi Ðề Tài Mới

Đánh dấu

Tags
abstract, bảng, class, interface, sánh,


Ðang đọc: 1 (0 thành viên và 1 khách)
 
Ðiều Chỉnh

Quyền viết bài
Bạn không thể gửi chủ đề mới
Bạn không thể gửi trả lời
Bạn không thể gửi file đính kèm
Bạn không thể sửa bài viết của mình

BB code is Mở
Mặt cười đang Mở
[IMG] đang Mở
HTML đang Tắt

Chuyển đến

Các chủ đề tương tự
Chủ đề Người khởi xướng chủ đề Diễn đàn Trả lời Bài mới gửi
Lỗi sau khi gỡ Level Class Mr.Khoale Hỏi/Đáp vBulletin 3.X 13 10-03-2010 04:22 PM
Help: Tên form truyền vào Class để mở form??? tranquochoann Visual C# 0 14-09-2009 06:34 PM
Help Em bị lỗi về Mod lever + Class hoangkhanh1604 Hỏi/Đáp vBulletin 3.X 0 08-07-2009 08:29 AM


Múi giờ GMT. Hiện tại là 07:59 PM
Powered by: vBulletin v3.8.2 Copyright ©2000-2010, Jelsoft Enterprises Ltd.
Xây Dựng Và Phát Triển Bởi Các Thành Viên SinhViênIT.Net
Liên hệ: Email VuThanhLai@Gmail.Com | Admin@SinhVienIT.Net
Ghi rõ nguồn SinhVienIT.Net khi sao chép bài ở đây !
Hosting Sponsored By hostmienphi.vn

 

Trang chủ | Diễn đàn | Thư viện Tutorial | Tin tức CNTT | Việc làm | Công cụ | Server Upload