Which code segment should you insert at line 10?

An application receives JSON data in the following format:


The application includes the following code segment. (Line numbers are included for reference only.)


You need to ensure that the ConvertToName() method returns the JSON input string as a Name object.
Which code segment should you insert at line 10?
A. Return ser.ConvertToType(json);
B. Return ser.DeserializeObject(json);
C. Return ser.Deserialize(json);
D. Return (Name)ser.Serialize(json);

microsoft-exams

3 thoughts on “Which code segment should you insert at line 10?

  1. Neither of answers is correct.
    Correct is: Return ser.Deserialize(json);
    Or Return (Name)(ser.DeserializeObject(json))
    Or Return ser.Deserialize(json, typeof(Name));

    1. The correct answer is c, but we can’t see the complete code:

      return ser.Deserialize < Name > (json);

Leave a Reply

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


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