当我以这种方式设置构造函数时,为什么会出现编译错误:
public class Castle
{
public Castle (bool mark, string description)
{
CastleMarked = mark;
CastleDescription = description;
}
bool CastleMarked {get; set;}
string CastleDescription {get; set;}
}
然后以这种方式从其他地方初始化它:
Castle cas1 = new Castle(true,"Stone");