i like to call the method in thread with aruguments and return some value here example
class Program
{
static void Main()
{
Thread FirstThread = new Thread(new ThreadStart(Fun1));
Thread SecondThread = new Thread(new ThreadStart(Fun2));
FirstThread.Start();
SecondThread.Start();
}
public static void Fun1()
{
for (int i = 1; i <= 1000; i++)
{
Console.WriteLine("Fun1 writes:{0}", i);
}
}
public static void Fun2()
{
for (int i = 1000; i >= 6; i--)
{
Console.WriteLine("Fun2 writes:{0}", i);
}
}
}
i know this above example run successfully but if method fun1 like this
public int fun1(int i,int j)
{
int k;
k=i+j;
return k;
}
then how can i call this in thread. Is it possible .Any body Help for me..i need all possible ways this