我最近开始学习C#。我刚刚了解到属性,并决定制作一个简单的程序,以便更多地了解它们。 这是我写的代码:使用属性时出现C#歧义错误
class Dog
{
private int weight;
private string colour;
public string colour { get; set; }
public Dog(int theWeight, string theColour)
{
weight = theWeight;
colour = theColour;
}
}
,我得到一个含糊不清的错误。 据我了解,这不应该发生。
当您对属性Color使用大写'C'时会发生什么?使用这种方法的 – 2010-08-03 07:42:35