「C#」引数なし、戻り値なしAction型の変数を使用
書式
Action cft = () =>処理コード
引数なし、戻り値なし
使用例
using System;
class Program
{
static void Main(string[] args)
{
Action cft = () => Console.WriteLine("hello world");
cft();
}
}
using System;
class Program
{
static void Main(string[] args)
{
Action cft = () => Console.WriteLine("hello world");
cft();
}
}
using System; class Program { static void Main(string[] args) { Action cft = () => Console.WriteLine("hello world"); cft(); } }
結果
hello world