我是 asp.net 的新手并尝试创建一个对象,但出现语法错误
public class pair
{
private string key;
private string value;
public pair(string key, string value)
{
this.key = this.setKey(key);
this.value = this.setValue(value);
}
private void setKey (string key) {
this.key = key;
}
public string getKey()
{
return this.key;
}
private void setValue(string value)
{
this.value = value;
}
public string getValue()
{
return this.value;
}
}
这两行
this.key = this.setKey(key);
this.value = this.setValue(value);
有问题,有人知道问题吗?