PRN221_-_SU_2024_-_Block_5_-_FE_2668.webp
pure_pearl

PRN221_-_SU_2024_-_Block_5_-_FE_2668.webp

Kizspy | Question: 36
(Choose 1 answer)
1.For Contact.xml file:
<?xml version="1.0"?>
<ArrayOfContact>
<Contact>
<ContactName >David</ContactName>
Phone>030-0074321</Phone>
< Contact>
</<Contact>
<ContactName>Jack</ContactName>
<Phone>050-763859</Phone></Contact>
</ArrayOfContact>
2. For code snippet:public class Contact{
public string ContactName { get; set; }
public string Phone { get; set; } }
//-
class Program{
static void Main(string[] args){
FileStream stream = File.Open("Contacts.xml", FileMode. Open);
var xs = new XmlSerializer(typeof(List<Contact>));var contactList = (List<Contact>)xs.Deserialize(stream);foreach (var contact in contactList){Console.WriteLine($"{contact.ContactName}");
}
Console.ReadKey();
FUOVER
}
Which one of the following is the output of the above code?
A. David
Jack
B. Jack
C. David
D. 050-763859
030-0074321

Thông tin

Category
PRN221
Thêm bởi
pure_pearl
Ngày thêm
Lượt xem
1,253
Lượt bình luận
4
Rating
0.00 star(s) 0 đánh giá

Share this media

Back
Bên trên Bottom