nerdexam
GIAC

GSSP-NET · Question #133

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…

The correct answer is B. XmlSerializer ObjectSerializer = new XmlSerializer(typeof(Employees)). See the full explanation below for the reasoning.

Question

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 GIAC GSSP-.NET Exam { public string EmpID; public string EmpName; public decimal Salary; } Which of the following code statements will John add in the application?

Options

  • AXmlSerializer ObjectSerializer = new XmlSerializer(typeof(Employees), ObjectTypes);
  • BXmlSerializer ObjectSerializer = new XmlSerializer(typeof(Employees));
  • CXmlSerializer ObjectSerializer = new XmlSerializer(Employees);
  • DXmlSerializer ObjectSerializer = new XmlSerializer();

How the community answered

(35 responses)
  • A
    9% (3)
  • B
    74% (26)
  • C
    3% (1)
  • D
    14% (5)

Community Discussion

No community discussion yet for this question.

Full GSSP-NET Practice