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

A.
New XmlSerializer(typeof(Location))

B.
New NetDataContractSerializer()

C.
New BataContractJsonSerializer (typeof (Location) )

D.
New DataContractSerializer(typeof(Location))



Leave a Reply 3

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


Kim Tae Hong

Kim Tae Hong

It’s maybe D
DataContractSerializer default action is xml and it’s parent is XmlObjectSerializer

Artem

Artem

Yes, [DataContract] and [DataMember] used for DataContractSerializer (xml format) and DataContractJsonSerializer (json format). Both implement XmlObjectSerializer (DataContractJsonSerializer too).

Guru

Guru

Netdatacontractserializer why not?