O'Reilly logo

Developing and Implementing Windows®-Based Applications with Visual C#™ .NET and Visual Studio® .NET Exam Cram™ 2 (Exam 70-316) by Priti Kalani, Amit Kalani, Kalani Kirk Hausman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Detailed Answers

A1: The correct answers are A and D. The Debug and Trace classes share the same Listeners collection. Therefore, you should add a listener object either to the Trace.Listeners collection or to the Debug.Listeners collection. Answer B is not correct because this solution will generate double entries in the event log. Answer C is not correct because the newly created listener object is not attached to the Listeners collection of the Trace and Debug classes.
A2: The correct answer is B. The Assert method checks for the given condition and generates an error when the condition evaluates to false. Answer A is not correct because this code segment will generate an error only when the value of TotalShipments is not equal to 0. Answers ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required