Share via


컴파일러 오류 CS0531

업데이트: 2007년 11월

오류 메시지

'member' : 인터페이스 멤버에는 정의를 사용할 수 없습니다.
'member' : interface members cannot have a definition

인터페이스에 선언한 메서드는 인터페이스 자체가 아니라 인터페이스에서 상속된 클래스에 구현해야 합니다.

다음 샘플에서는 CS0531 오류가 발생하는 경우를 보여 줍니다.

// CS0531.cs
namespace x
{
   public interface clx
   {
      int xclx()   // CS0531, cannot define xclx
      // Try the following declaration instead:
      // int xclx();
      {
         return 0;
      }
   }

   public class cly
   {
      public static void Main()
      {
      }
   }
}