Which two statements about the sr and textFromFile variables are true?

Posted by: Pdfprep Category: MB6-894 Tags: , ,

You are an Independent Software Vendor (ISV) developer, and you are reviewing the code in a solution.

During the code review, you see the following:

using (var sr = new System.IO.StreamReader(_inputFilename))

{

var textFromFile = sr.ReadToEnd();

this.processFileDate(textFromFile);

}

Which two statements about the sr and textFromFile variables are true? Each correct answer presents a complete solution.
A . The variables storing .Net Framework objects have to be declared using the var keyword.
B . The var keyword indicates the variables can store values of any type.
C . The variables are valid within the block of code in which they were declared.
D . The var keyword infers the type of the variables from their initialization expression.

Answer: CD

Leave a Reply

Your email address will not be published.