任何人都可以告訴我這個控制檯應用程序做了什麼嗎?究竟發生了什麼?c中的獲取者和安裝者#
此外,還有錯誤。你能解決他們嗎?
public class Program
{
static void Main(string[] args)
{
Name n = new Name[5]; // error
n[0] = new Name(0); //error
n[0] = "hgfhf"; //is this possible in this program?
string nam = n[0];
}
}
public class Name
{
private string[] name;
private int size;
public Name(int size)
{
this.name = new string[size];
this.size = size;
}
public string this[int pos] // what does this mean?
{
get
{
return name[pos];
}
set
{
name[pos] = value;
}
}
}
糟糕的標點符號... – RedFilter 2010-09-04 09:42:34
請刪除txtspk,它只會讓你很難讀出你想說的話。 – Guffa 2010-09-04 09:42:55
如果你想使用StackOverflow,請在你的問題上付出一些努力。我只是*爲你翻譯它;不要使用'文本'的發言,並至少嘗試使用正確的拼寫和標點符號。 – GenericTypeTea 2010-09-04 09:44:03