About 15,400,000 results
Open links in new tab
  1. c# - Interfaces — What's the point? - Stack Overflow

    In the example given below taken from a different C# interfaces thread on stack overflow, I would just create a base class called Pizza instead of an interface.

  2. c# - What is the difference between an interface and a class, and …

    Oct 2, 2019 · What is the difference between an interface and a class, and why I should use an interface when I can implement the methods directly in the class?

  3. C# How to use interfaces - Stack Overflow

    2 What ? Interfaces are basically a contract that all the classes implementing the Interface should follow. They looks like a class but has no implementation. In C# Interface names by …

  4. How can I use interface as a C# generic type constraint?

    Jul 8, 2009 · Is there a way to get the following function declaration? public bool Foo<T>() where T : interface; ie. where T is an interface type (similar to where T : class, and struct). …

  5. c# - How is it possible to initialize an interface? - Stack Overflow

    Dec 31, 2019 · COM uses a hyper-pure interface-based programming style. You only ever use an interface, the implementation is completely hidden. Basic reason why it is usable in practically …

  6. c# - Interface defining a constructor signature? - Stack Overflow

    It's weird that this is the first time I've bumped into this problem, but: How do you define a constructor in a C# interface? Edit Some people wanted an example (it's a free time project, …

  7. c# - C#8 interface defaults: How to implement default properties …

    Apr 15, 2022 · An SDK can use default interface implementations to allow adding new interfaces and members without breaking existing code. That's used in Android, where many SDK …

  8. c# - Optional parameters for interfaces - Stack Overflow

    Apr 2, 2010 · Using c# 4.0 -- building an interface and a class that implements the interface. I want to declare an optional parameter in the interface and have it be reflected in the class. So, …

  9. C# constructor in interface - Stack Overflow

    I know that you can't have a constructor in an interface, but here is what I want to do: interface ISomething { void FillWithDataRow(DataRow) } class FooClass<T> where T : ISomet...

  10. c# - How can I implement static methods on an interface ... - Stack ...

    Feb 23, 2012 · Interface methods are meant to be implemented as instance methods. If you want replicate the methods of an static api to an interface, you can create a class that implement …