Dave --
From a website comparing C# and C++
3.3 Is a C# interface the same as a C++ abstract class?
No, not quite. An abstract class in C++ cannot be instantiated, but it can (and often does) contain implementation code and/or data members. A C# interface cannot contain any implementation code or data members - it is simply a group of method names & signatures. A C# interface is more like a COM interface than a C++ abstract class.
The other major difference is that a C# class can inherit from only one class (abstract or not), but can implement multiple interfaces.
Jay
>Interface inheritance will still play a big part in VB.NET development. For example, you have a linked list class and you want to save customer objects in the linked list. One way is to use implementation inheritance and make customer a subclass of linked list in order to inherit its behavior. This would be an invalid use of inheritance because implementation inheritance should be used for "is a" type relationships only (i.e. customer is a person not a linked list). The key will being able to identify when each type of inheritance is appropriate.
>
>I personally haven't seen any references to C# not being able to do interface inheritance, but I will keep my eyes open.
>
>
>-Dave
>
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only