Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Interfaces cannot contain constructors
Constructors cannot be defined for interfaces. A method is considered a constructor if it has the same name as the class and no return type.
The following sample generates CS0526:
// CS0526.cs
namespace x
{
public interface clx
{
public clx() // CS0526
{
}
}
public class cly
{
public static void Main()
{
}
}
}