exam questions

Exam 70-483 All Questions

View all questions & answers for the 70-483 exam

Exam 70-483 topic 1 question 52 discussion

Actual exam question from Microsoft's 70-483
Question #: 52
Topic #: 1
[All 70-483 Questions]

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 XML.
Which code segment should you insert at line 20?

  • A. new XmlSerializer(typeof(Location))
  • B. new NetDataContractSerializer()
  • C. new DataContractJsonSerializer(typeof (Location))
  • D. new DataContractSerializer(typeof(Location))
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️
The code is using [DataContract] attribute here so need to used DataContractSerializer class.

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
SwordMaster
Highly Voted 4 years, 5 months ago
D is correct, cause DataContractSerializer inherits XmlObjectSerializer. So there is no more choices.
upvoted 6 times
...
xman
Most Recent 5 years, 2 months ago
I think the answer is A DataContractSerializer is Serializes and deserializes an instance of a type into an XML stream or document using a supplied data contract. This class cannot be inherited.
upvoted 3 times
whtvr
5 years, 2 months ago
but A. new XmlSerializer(typeof(Location)) and the DataContractSerializer is D, so correct
upvoted 5 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago