namespace point
{
class Program
{
public class greetings
{
public static void EnglishGreeting()
{
Console.WriteLine("Hello World!");
}
public static void SpanishGreeting()
{
Console.WriteLine("Ciao,mondo!");
}
public static void ItaliamGreeting()
{
Console.WriteLine("Hola,imundo!");
}
delegate void greetingdele();
class hello
{
static void Main(string[] args)
{
int iChoice = int.Parse (args[0]);
greetingdele[] deletest =
{
new greetingdele (greetings.ItaliamGreeting),
new greetingdele (greetings .EnglishGreeting),
new greetingdele (greetings .SpanishGreeting)
};
deletest[iChoice -1]();
}
}
}
}
}
问题1:int.Parse(args[0])这句是什么意思?
问题2:deletest[iChoice-1]()是怎么一一访问到委托数组的元素的?
问题3:Main方法里的参数 string[] args 有什么用?
哆啦的时光机