I have a method in class A which I want to thread start it in class B by passing parameters.
class ClassA
{
public void MethodA(string par1, int par2)
{
Console.WriteLine("Parameter " + par1 + " is passed with value " + par2);
}
}
class ClassB
{
public static void Main(string[] args)
{
ClassA obj = new ClassA();
Thread workerThread = new Thread(new ParameterizedThreadStart(obj.MethodA));
workerThread.Start("book",5);
}
}
But when I execute the code it gave me an error `
No overload for 'MethodA' matches delegate 'System.Threading.ParameterizedThreadStart
What is the problem?