public void ExampleMethod()
{
// 这是一个返回类型为 void 的方法示例
Console.WriteLine("这是一个返回类型为 void 的方法。");
}
class Program
{
static void Main(string[] args)
{
ExampleMethod();
}
}
void 是 C# 中的一种返回类型,表示该方法不返回任何值。ExampleMethod 方法的返回类型是 void,因此它不会返回任何值。Console.WriteLine 用于在控制台输出信息。Main 方法是程序的入口点,调用了 ExampleMethod 方法。上一篇:c# private
下一篇:c#字符串转byte数组
Laravel PHP 深圳智简公司。版权所有©2023-2043 LaravelPHP 粤ICP备2021048745号-3
Laravel 中文站