public static void Main() { Console.WriteLine("Please enter the target number"); int target = Convert.ToInt32(Console.ReadLine()); sumOfNumbersCallback callback = new sumOfNumbersCallback(PrintSum); Number numb = new Number(target, callback); Thread t1 = new Thread(new ThreadStart(numb.PrintSumOftNumbers)); t1.Start(); }
public Number(int target, sumOfNumbersCallback callBackMethod) { this._target = target; this._callBackMethod = callBackMethod; }