Hello,
I am just writing simple threading program in C# program, I am coming from VB.Net and just wondering why my WriteY() function has to be a static. I through this could be public or private.
Can anyone explain why it has to be a static.
Many thanks,
Steve
I am just writing simple threading program in C# program, I am coming from VB.Net and just wondering why my WriteY() function has to be a static. I through this could be public or private.
Can anyone explain why it has to be a static.
Many thanks,
Steve
Code:
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading;
namespace App1
{
class Program
{
static void Main(string[] args)
{
Thread t = new Thread(WriteY);
t.Start();
while (true) Console.Write("X");
}
static void WriteY()
{
while (true)
Console.Write("Y");
}
}
}