Method 'ThreadTest.WriteY()' referenced without parentheses - C#
Формулировка задачи:
начала изучать потоки....не могу понять в чем ошибка
ему не нравится в строке Thread t = new Thread(WriteY);
WriteY
говорит:"Method 'ThreadTest.WriteY()' referenced without parentheses"
using System;
using System.Threading;
namespace ThreadExample
{
/// <summary>
/// Summary description for Class1.
/// </summary>
class ThreadTest
{
static void Main()
{
Thread t = new Thread(WriteY);
t.Start(); // Выполнить WriteY в новом потоке
while (true)
Console.Write("x"); // Все время печатать 'x'
}
static void WriteY()
{
while (true)
Console.Write("y"); // Все время печатать 'y'
}
}
}Решение задачи: «Method 'ThreadTest.WriteY()' referenced without parentheses»
textual
Листинг программы
new Thread(WriteY);