When I try to compile it gives me
Error 1 An object reference is required for the non-static field, method, or property 'ConsoleApplication1.Program.print(string)' ConsoleApplication1\ConsoleApplication1\Program.cs 15 47 ConsoleApplication1
So, I marked print as static and it works. But in a bigger program I have non-static methods. So how do I use ThreadPool with those methods?
class Program
{
static void Main(string[] args)
{
ThreadPool.QueueUserWorkItem(o => print("hello"));
Console.ReadLine();
}
public void print(string s)
{
Console.WriteLine(s);
}
}