The following code is from Microsoft MSDN.
If compile this, following error occurs at class MainClass : Employee4.
'StaticClass.Employee4' does not contain a constructor that takes 0 arguments
Can anybody find any wrong in the code?
C#:
public class Employee4
{
public string id;
public string name;
public Employee4()
{
}
public Employee4(string name, string id)
{
this.name = name;
this.id = id;
}
public static int employeeCounter;
public static int AddEmployee()
{
return ++employeeCounter;
}
}
class MainClass : Employee4 //compile error here!!!
{
static void Main(string[] args)
{
}
}
'StaticClass.Employee4' does not contain a constructor that takes 0 arguments
Can anybody find any wrong in the code?