Share via


컴파일러 오류 CS0736

업데이트: 2007년 11월

오류 메시지

'type name'은(는) 'member name' 인터페이스 멤버를 구현하지 않습니다. 'method name'은(는) static이므로 인터페이스 멤버를 구현할 수 없습니다.
'type name' does not implement interface member 'member name'. 'method name' cannot implement an interface member because it is static.

이 오류는 static 메서드가 인터페이스 멤버의 구현으로 암시적이거나 명시적으로 선언된 경우에 생성됩니다.

이 오류를 해결하려면

  • 메서드 선언에서 static 한정자를 제거합니다.

  • 인터페이스 메서드의 이름을 변경합니다.

  • 인터페이스에서 상속되지 않도록 포함하는 형식을 다시 정의합니다.

예제

다음 코드에서는 Program.testMethod가 static으로 선언되기 때문에 CS0736 오류가 발생하는 경우를 보여 줍니다.

// cs0736.cs
namespace CS0736
{   

    interface ITest
    {
        int testMethod(int x);
    }

    class Program : ITest // CS0736
    {
        public static int testMethod(int x) { return 0; }
        // Try the following line instead.
        // public int testMethod(int x) { return 0; }
        public static void Main() { }
    }    
}

참고 항목

참조

인터페이스(C# 프로그래밍 가이드)