using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication1
{
public delegate void D(int i);
class P
{
public static void Main(string[] args)
{
V(new D(R));
}
public static void V(D d) {
d(21);
}
public static void R(int s) {
Console.WriteLine(s.ToString());
Console.ReadLine();
}
}
}
运行结果为21
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication1
{
public delegate void D(int i);
class P
{
public static void Main(string[] args)
{
V(new D(R));
}
public static void V(D d) {
d(21);
}
public static void R(int s) {
Console.WriteLine(s.ToString());
Console.ReadLine();
}
}
}
运行结果为21