class Class_B
{
public void a()
{
Console.WriteLine("no parameters function");
}
public void a(int i, int j)
{
Console.WriteLine("{0}+{1}={2}", i, j, i + j);
}
}
public class test
{
public static void Main(string[] args)
{
Class_B b = new Class_B();
b.a();
b.a(2, 6);
}
}
运行结果.
no parameters function
2+6=8