📜  如何在c#代码示例中定义一个函数

📅  最后修改于: 2022-03-11 14:49:00.056000             🧑  作者: Mango

代码示例6
public void SayHello(string name) 
{
    Console.WriteLine("Hello");
}

public void SayName()
{
    Console.WriteLine("What is your name?");
    string name = Console.ReadLine(); 
    SayHello(name);
}