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

    Hmm, the OP was asking "From what I understand, interface is kind of a work around for the non-existent multi-inheritance which doesn't exist in C#. (Other than that, in the quoted textbook …

  2. c# - Test if object implements interface - Stack Overflow

    Jan 4, 2009 · What is the simplest way of testing if an object implements a given interface in C#? (Answer to this question in Java)

  3. 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, …

  4. c# - Why can't I have protected interface members? - Stack Overflow

    An interface is all about what a certain object can do, so when using a class which implements that interface the developer will expect all the members to be implemented, so the protected …

  5. 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 …

  6. C# Interface<T> { T Func<T> (T t);} : Generic Interfaces with ...

    Oct 26, 2009 · Yeah, to be specific, you need: public interface IReadable <T> { T Read (string ID); } So there's only one actual generic parameter here, the T for the interface type definition.

  7. 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). Currently …

  8. How do I override the equals operator == for an interface in C#?

    The operator == is static. You cannot define static methods for interfaces in C#. Also, for all operators at least one of the argument types needs to be of the same type as the class it is …

  9. 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, …

  10. Why can't C# interfaces contain fields? - Stack Overflow

    Jan 22, 2010 · Interfaces don't contain fields because fields represent a specific implementation of data representation, and exposing them would break encapsulation. Thus having an interface …