Multiple Choice
Consider the following code segment:
{
Var exampleObject = new ExampleClass() ;
Try
{
ExampleObject.SomeMethod() ;
}
Finally
{
If (exampleObject != null)
{
ExampleObject.Dispose() ;
}
}
}
Which of the following using statements is equivalent to the preceding code segment
A) try using (var exampleObject = new ExampleClass() )
{
ExampleObject.SomeMethod() ; // do something with exampleObject
}
B) using (var exampleObject = new ExampleClass() )
{
ExampleObject.SomeMethod() ; // do something with exampleObject
}
C) using (var exampleObject = new ExampleClass() )
{
ExampleObject.SomeMethod() ; // do something with exampleObject
ExampleObject.Dispose() ;
}
D) try using (var exampleObject = new ExampleClass() )
{
ExampleObject.SomeMethod() ; // do something with exampleObject
ExampleObject.Dispose() ;
}
Correct Answer:

Verified
Correct Answer:
Verified
Q4: Each Exception should have three constructors: A
Q5: Which of the following is false regarding
Q6: After an exception has occurred and a
Q7: The base class for all exception classes
Q8: Runtime exceptions can usually be fixed by
Q10: In order to display the error message
Q11: The constructor method for an exception class
Q13: Exceptions can occur:<br>A) from C#'s CLR<br>B) through
Q14: Which of the following statements is false<br>A)
Q18: Which of the following statements is true?<br>A)