Which of the following code statements will John add in the application?

Posted by: Pdfprep Category: GSSP-.NET Tags: , ,

John works as a Software Developer for InfoTech Inc. He develops an application named SerializeObj. He creates a custom class and wants to serialize its object. He also wants the object to be stored into an XML file named File1.xml.

He writes the following code:

public class Employees

{

public string EmpID;

public string EmpName;

public decimal Salary;

}

Which of the following code statements will John add in the application?
A . XmlSerializer ObjectSerializer = new XmlSerializer(typeof(Employees), ObjectTypes);
B . XmlSerializer ObjectSerializer = new XmlSerializer(typeof(Employees));
C . XmlSerializer ObjectSerializer = new XmlSerializer(Employees);
D . XmlSerializer ObjectSerializer = new XmlSerializer();

Answer: B

Leave a Reply

Your email address will not be published.