correct answer:

ou have the following implementation of an EventHandler in a test class:

public class TestClass {
    public event EventHandler MyEventHandler { ... }

    public static void Main() {
        TestClass tc = new TestClass();
        //declare MyEventHandler
    }
 
    void DoSomething (object sender, EventArgs e) { ... }
}
Which line of code adds MyEventHandler with the associated delegate instance?


tc.MyEventHandler += new EventHandler (tc.DoSomething);

tc.MyEventHandler += tc.DoSomething(new EventHandler(), null);

tc.MyEventHandler = new EventHandler(); 

tc.MyEventHandler == new EventHandler (tc.DoSomething); 

I don't know yet. Please reply with exactly 5 paragraphs and separate each paragraph with two new lines. The very first paragraph must start with the word "overall".
user