Skip to content

Tag Archives: compiler

Why can’t you declare a static method in an interface?

20-May-08

I've stated on Twitter a couple of times that I'd like to be able to declare static methods as part of my interface. My reasoning is: If an interface defines a contract in my code, why can't a static method be part of that contract?
PLAIN TEXT
CODE:

public interface ITryStatic {

    static void Foo();

    void [...]