nerdexam
Microsoft

98-372 · Question #3

You are creating an application using .NET Framework 4.0. You need to run numerous lines of code after the application runs, regardless of whether or not an exception occurred. Which type of block…

The correct answer is D. Finally. You will implement the finally block to implement this. A block of code that appears just after the finally statement is called a finally block. The statements in a finally block are executed immediately after execution of the try/catch block. The finally block is optional…

Understanding Cloud Concepts

Question

You are creating an application using .NET Framework 4.0. You need to run numerous lines of code after the application runs, regardless of whether or not an exception occurred. Which type of block can you use to implement this?

Options

  • ATry
  • BCatch
  • CManaged handler
  • DFinally

How the community answered

(34 responses)
  • A
    3% (1)
  • B
    12% (4)
  • C
    3% (1)
  • D
    82% (28)

Explanation

You will implement the finally block to implement this. A block of code that appears just after the finally statement is called a finally block. The statements in a finally block are executed immediately after execution of the try/catch block. The finally block is optional. However, each try statement must have at least one catch block or a finally block. When a finally block is defined in a source code, it is guaranteed to execute, regardless of whether or not an exception is thrown. Answer: B and A are incorrect. The try...catch block is used to handle runtime errors. In an event procedure, the try statement is placed just before the statements that might cause an The catch statement is placed just before the list of statements that are to be run if a runtime error //Statements that might cause a runtime error. //Statements to be run if a runtime error occurs. Answer: C is incorrect. A managed handler enables a user to call a .NET library to process a request. When a managed handler is added for a specific application, it works properly using .NET Libraries. For security reasons, it should always be kept in mind to make this handler available only to the Web application that requires it. This reduces the possibility of any unauthorized access or other types of attacks.

Topics

#.NET Framework#exception handling#finally block#error management

Community Discussion

No community discussion yet for this question.

Full 98-372 Practice