[問題]請問一下 謝謝
namespace Application
{
///The DataObject class stored with a key
class DataObject
{
///populate
}
class program
{
static Hashtable Data = new Hashtable();
static string[] StaticData = new string[]{
"X-Ray", "Echo", "Alpha", "Yankee", "Bravo", "Charlie"
"Delta", "Hotel", "India", "Juliet", "Foxtrot", "Sierra",
"Milk", "Kilo", "lima", "Nomber", "Oscar", "Papa", "Qubec"
"Remeo", "Tango", "Golf", "Uniform", "Victor", "Whisky",
"Zulu"};
static void Main (string[] args)
{
for(int i= 0; i<StaticData.Length; i++)
Data.Add(StaticData[i].ToLower(), new DataObject(
StaticData[i]));
while(true)
{
PrintStortedData();
Console.WriteLine();
Console.Write(">");
string str = Console.ReadLine();
string[] strs = str.Sp;it(' ');
if(strs[0]=="q")
break;
else if(strs[0]=="print")
PrintSortedData();
else if(strs[0]=="inc")
Increase(strs[1]);
else if(strs[0]=="dec")
Decrease(strs[1]);
else if(strs[0]=="swap")
Swap(strs[1], strs[2]);
else if(strs[0]=="ref")
Ref(strs[1], strs[2]);
else if(strs[0]=="unref")
UnRef(strs[1]);
}
}
}
在這邊請問各位大大
因為我是c#的初學者
上來之前我也做了一下功課,有唸書.大致上知道上面的程式是在講什麼
但是還是有些不太懂的地方,想請問一下大家程式第三行註解那邊
The DataObject class stored with a key 不太懂他的意思
我知道他要我做什麼寫那個類別,但是英文不太好.可以為我解說他的意思嘛?
另外在程式26~27行 後半段 new DataObject(StaticData[i])
為什麼它可以那樣寫,不太能理解.謝謝
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 24.18.201.98
推
06/25 21:41, , 1F
06/25 21:41, 1F
→
06/25 21:43, , 2F
06/25 21:43, 2F
→
06/25 21:45, , 3F
06/25 21:45, 3F
→
06/25 21:46, , 4F
06/25 21:46, 4F
→
06/25 21:46, , 5F
06/25 21:46, 5F
→
06/25 23:44, , 6F
06/25 23:44, 6F
→
06/25 23:46, , 7F
06/25 23:46, 7F
→
06/25 23:49, , 8F
06/25 23:49, 8F
→
06/25 23:50, , 9F
06/25 23:50, 9F
→
06/25 23:51, , 10F
06/25 23:51, 10F
→
06/25 23:51, , 11F
06/25 23:51, 11F
推
06/26 00:25, , 12F
06/26 00:25, 12F
→
06/26 00:27, , 13F
06/26 00:27, 13F
→
06/26 00:28, , 14F
06/26 00:28, 14F
→
06/26 00:29, , 15F
06/26 00:29, 15F
→
06/26 00:30, , 16F
06/26 00:30, 16F
推
06/26 00:55, , 17F
06/26 00:55, 17F