Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is it possible to buy a Framework for VB.net
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00601927
Message ID:
00604558
Vues:
37
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
>
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform