Which of the following statements about inheritance and events is false?
- A derived class can raise a base class event by using code similar to the following:
if (base.EventName != null) base.EventName(this, args);
- A derived class cannot raise an event defined in an ancestor class.
- A class can define an OnEventNamemethod that raises an event to allow derived classes to raise that event.
- A derived class inherits the definition of the base class’s events, so a program can subscribe to a derived object’s event.
Good question.
댓글
댓글 쓰기