should you use?

You are creating a Windows Forms application by using the .NET Framework 3.5. The
application requires a thread that accepts a single integer parameter.You write the following
code segment. (Line numbers are included for reference only.)
01 Thread myThread = new Thread(new
ParameterizedThreadStart(DoWork));
02 myThread.Start(100);
03 …
You need to declare the method signature of the DoWork method. Which method signature
should you use?

You are creating a Windows Forms application by using the .NET Framework 3.5. The
application requires a thread that accepts a single integer parameter.You write the following
code segment. (Line numbers are included for reference only.)
01 Thread myThread = new Thread(new
ParameterizedThreadStart(DoWork));
02 myThread.Start(100);
03 …
You need to declare the method signature of the DoWork method. Which method signature
should you use?

A.
public void DoWork()

B.
public void DoWork(int nCounter)

C.
public void DoWork(object oCounter)

D.
public void DoWork(Delegate oCounter)

Explanation:
DoWorkEventArgs only supports parameters of type object: DoWorkEventArgs(object argument)



Leave a Reply 0

Your email address will not be published. Required fields are marked *