Edit

Share via


Compiler Error CS0525

Interfaces cannot contain instance fields

An interface can contain methods and properties and fields.

The following sample generates CS0525:

C#
// CS0525.cs  
namespace x  
{  
   public interface clx  
   {  
      public int i;   // CS0525  
   }  
}