Question:You work as an application developer at Certkiller .com. Certkiller .com wants you to
develop an application that stores and retrieves staff information by means of a unique staff number. You
have already written the following code for the purpose of storing Employee objects.
Dim e1 As New Employee(1001, "Andy Reid", "Manager")
Dim e2 As New Employee(1002, "Kara Lang", "Sales Engineer")
Dim eData As New Dictionary(Of Integer, Employee)()
eData.Add(e1.ID, e1)
eData.Add(e2.ID, e2)
All other Employee objects have been added in the same way. You are required to display all key/value
pairs within the Dictionary collection. What should you do? -(VB.NET) 

A Use the following code:
For Each keyPair As KeyValuePair(Of Integer, Employee) In eData
Console.WriteLine("{0} key : {1} value", keyPair.Key, keyPair.Value)
Next 

B Use the following code:
For Each key__1 As String In eData.Keys
Console.WriteLine("{0} key : {1} value", Key, DirectCast(eData(key__1), Employee))
Next 

C Use the following code:
For Each keyPair As KeyValuePair In eData
Console.WriteLine("{0} key : {1} value", keyPair.Key, keyPair.Value)
Next 

D Use the following code:
For Each value As Object In eData.Values
Console.WriteLine("{0} key : {1} value", eData(value), value)
Next 

+ Answer
+ Report
Total Preview: 1318

Copyright © 2024. Powered by Intellect Software Ltd