Which code segment should you insert at line 20?

You are developing an application. The application converts a Location object to a string by using a method named WriteObject. The WriteObject() method accepts two parameters, a Location object and an XmlObjectSerializer object.
The application includes the following code. (Line numbers are included for reference only.)


You need to serialize the Location object as a JSON object.
Which code segment should you insert at line 20?
A. New DataContractSerializer(typeof(Location))
B. New XmlSerializer(typeof(Location))
C. New NetDataContractSenalizer()
D. New DataContractJsonSerializer(typeof(Location))

microsoft-exams

One thought on “Which code segment should you insert at line 20?

  1. answer is D.

    However, went through some similar question but changed this part:
    You need to serialize the Location object as a XML object.
    then the answer is “New DataContractSerializer(typeof(Location))”

Leave a Reply

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


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