1.suppose the movedeventhandler delegate is defined by the statement delegate

Project Description:

1.suppose the movedeventhandler delegate is defined by the statement delegate void movedeventhandler(). which of the following correctly declares the moved event? a.public movedeventhandler movedevent; b.public event movedeventhandler movedevent; c.public event action movedevent; d.both b and c are correct. 2.suppose the employee class is derived from the person class and the person class defines an addresschanged event. which of the following should you not do to allow an employee object to raise this event? a.create an onaddresschanged method in the person class that raises the event. b.create an onaddresschanged method in the employee class that raises the event. c.make the employee class call onaddresschanged as needed. d.make the code in the person class that used to raise the event call the onaddresschanged method instead. 3.which of the following statements subscribes the mybutton_click event handler to catch the mybutton control’s click event? a.mybutton.click += mybutton_click; b.mybutton_click += mybutton.click; c.mybutton_click handles mybutton.click; d.mybutton.click = mybutton_click; 4.suppose the car class provides a stopped event that takes as parameters sender and stoppedargs objects. suppose also that the code has already created an appropriate stoppedargs object named args. then which of the following code snippets correctly raises the event? a.if (!stopped.isempty) stopped(this, args); b.if (stopped) stopped(this, args); c.if (stopped != null) stopped(this, args); d.raise stopped(this, args); 5.which of the following statements about events is false? a.if an object subscribes to an event twice, its event handler executes twice when the event is raised. b.if an object subscribes to an event twice and then unsubscribes once, its event handler executes once when the event is raised. c.if an object subscribes to an event once and then unsubscribes twice, its event handler throws an exception when the event is raised. d.in a windows forms application, you can use the properties window to subscribe and unsubscribe events, and to create empty event handlers.6.which of the following statements about inheritance and events is false? a.a derived class can raise a base class event by using code similar to the following: if (base.eventname != null) base.eventname(this, args); b.a derived class cannot raise an event defined in an ancestor class. c.a class can define an oneventname method that raises an event to allow derived classes to raise that event. d.a derived class inherits the definition of the base class’s events, so a program can subscribe to a derived object’s event. 7.which of the following statements about exception handling is true? a.you can nest a try-catch-finally block inside a try, catch, or finally section. b.a try-catch-finally block must include at least one catch section and one finally section. c.an exception is handled by the catch section that has the most specific matching exception type. d.the code in a finally section executes if the code finishes without an error or if a catch section handles an exception but not if the code executes a return statement. 8.which of the following methods can you use to catch integer overflow exceptions? a.use a try-catch-finally block. b.use a checked block and a try-catch-finally block. c.check the advanced build settings dialog’s overflow/underflow box, and use a try-catch-finally block. d.either b or c. 9.which of the following returns true if variable result holds the value float.positiveinfinity? a.result == float.positiveinfinity b.float.isinfinity(result) c.float.ispositiveinfinity(result) d.all of the above. 10.which of the following statements about throwing exceptions is false? a.if you catch an exception and throw a new one to add more information, you should include the original exception in the new one’s innerexception property. b.if you rethrow the exception ex with the statement throw, the exception’s call stack is reset to start at the current line of code. c.if you rethrow the exception ex with the statement throw ex, the exception’s call stack is reset to start at the current line of code. d.before a method throws an exception, it should clean up as much as possible, so the calling code has to deal with the fewest possible side effects.11.which of the following should you not do when building a custom exception class? a.derive it from the system.exception class, and end its name with exception. b.give it event handlers with parameters that match those defined by the system.exception class. c.make it implement idisposable. d.give it the serializable attribute.
Skills Required:
Project Stats:

Price Type: Fixed

Project Budget: $0 to $10
Expired
Total Proposals: 1
1 Current viewersl
21 Total views
Project posted by:

Proposals

Proposals Reputation Price offered
  • 4.6
    647 Jobs 468 Reviews
    $20 in 1 Day