6
這些與函數調用之間是否有任何功能差異?閉包和任務
方法一:
public static void PrintMe(object obj)
{
Task task = new Task(() =>
{
Console.WriteLine(obj.ToString());
});
task.Start();
}
方法2:
public static void PrintMe(object obj)
{
Task task = new Task((object arg) =>
{
Console.WriteLine(arg.ToString());
}, obj);
task.Start();
}