Which code segment should you use?

You are developing an application that uses structured exception handling. The application includes a
class named ExceptionLogger.
The ExceptionLogger class implements a method namedLogException by using the following code
segment:
public static void LogException(Exception ex) You have the following requirements:
-Log all exceptions by using the LogException() method of the ExceptionLogger class.
-Rethrow the original exception, including the entire exception stack.
You need to meet the requirements.
Which code segment should you use?

You are developing an application that uses structured exception handling. The application includes a
class named ExceptionLogger.
The ExceptionLogger class implements a method namedLogException by using the following code
segment:
public static void LogException(Exception ex) You have the following requirements:
-Log all exceptions by using the LogException() method of the ExceptionLogger class.
-Rethrow the original exception, including the entire exception stack.
You need to meet the requirements.
Which code segment should you use?

A.
Option A

B.
Option B

C.
Option C

D.
Option D



Leave a Reply 7

Your email address will not be published. Required fields are marked *


MarcoJacob

MarcoJacob

Ok, its A

Google

Google

Please stop by the web pages we follow, such as this 1, because it represents our picks in the web.

Google

Google

Just beneath, are a lot of totally not connected internet sites to ours, even so, they may be certainly really worth going over.

app builder

app builder

the time to read or take a look at the subject material or web sites we have linked to beneath the

Anu

Anu

A and not B bcoz “throw ex” will reset the stack

Herman McConnell

Herman McConnell

A is right. Cause, throw ex will reset stack trace of original exception, when throw will resend exception without any changes to a caller.