C# FAQ: Is a Cplusplus abstract class like a CSharp interface
Microsoft .NET Framework, ASP.NET, Visual C# (CSharp, C Sharp, C-Sharp) Developer Training, Visual Studio
| CSharp-Online.NET:FAQs |
| edit |
[edit]
Is a C++ abstract class like a C# interface?
No, a C# interface is not the same thing as a C++ abstract class. In C++, an abstract class cannot be instantiated; but, it can include data members and-or implementation code.
In contrast, a C# interface cannot contain data members and-or implementation code. A C# interface is little more than a collection of method signatures. Thus, a C# interface is more like a COM interface than a C++ abstract class.
[edit]
See also
- Implement .NET Framework interfaces
- Implementing Interfaces
- Interface
- Interface-Based Programming
- Should I use an abstract class or an interface?
- Test for an interface implementation
- Using Inheritance Effectively
- Visual Studio: Implementing interfaces