GIAC
GSSP-.NET · Question #67
(Topic 1) 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…
The correct answer is B. XmlSerializer ObjectSerializer = new XmlSerializer(typeof(Employees)). See the full explanation below for the reasoning.
Question
- (Topic 1)
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 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
(39 responses)- A3% (1)
- B79% (31)
- C10% (4)
- D8% (3)
Community Discussion
No community discussion yet for this question.