这么简单的程序都调不通,请求高手帮助!
rzg 2002-01-24 12:03:14 代码如下:
using System;
delegate int MyDelegate();
public class MyClass
{
public void InstanceMethod(){
Console.WriteLine("Call the Static mecthod");
//return 0;
}
static pulic viod StaticMethod() {
Console.WriteLine("Call the static method");
//return 0;
}
}
public class Test
{
static public void Main()
{
MyClass p=new MyClass();
MyDelegate d= new MyDelegate(p.InstanceMethod);
d();
d=new MyDelegate(MyClass.StaticMethod);
d();
}
}
错误为:Test01.cs(11,21): error CS1002: ; expected
请问这是为何?