Which code segment should you use?

You are developing an application that will read data from a text file and display the file contents.
You need to read data from the file, display it, and correctly release the file resources.
Which code segment should you use?


A. Option A
B. Option B
C. Option C
D. Option D

microsoft-exams

4 thoughts on “Which code segment should you use?

  1. “D” is correct!
    Because the question is: “correctly release the file resources”
    Close releases the used resources and Dispose releses the unmanaged resources

Leave a Reply

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


The reCAPTCHA verification period has expired. Please reload the page.