GIAC GIAC Secure Software Programmer - C#.NET GSSP-.NET Question # 8 Topic 1 Discussion

GIAC GIAC Secure Software Programmer - C#.NET GSSP-.NET Question # 8 Topic 1 Discussion

GSSP-.NET Exam Topic 1 Question 8 Discussion:
Question #: 8
Topic #: 1

Peter works as a Software Developer for PentaSoft Inc. He develops an application, named App1, using Visual C# .NET. The application is intended to deal with several file input and output operations. He uses the following try structure in the application code to handle errors that occur during the execution of App1.

try

{

//Statements that might cause a runtime error.

}

catch (System.IO.FileNotFoundException ex)

{

//Statements

}

catch (System.IO.PathTooLongException ex)

{

//Statements

}

catch (System.IO.IOException ex)

{

//Statements

}

catch (Exception ex)

{

//Statements

}

What will happen if an exception of type System.IO.DirectoryNotFoundException occurs in the try block?


A.

The catch block that handles an exception of type IOException will be executed.


B.

The catch block that handles an exception of type Exception will be executed.


C.

The catch block that handles an exception of type FileNotFoundException will be executed.


D.

The catch block that handles an exception of type PathTooLongException will be executed.


Get Premium GSSP-.NET Questions

Contribute your Thoughts:


Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.