Question:Certkiller .com wants you to develop an application that stores and retrieves employee
information by means of a unique staff number.
You create a custom collection class, which implements the type-safe IDictionary interface. This collection
class is named EmployeeCollection, and is defined using the following code.
Public Class EmployeeCollection
Implements IDictionary(Of Integer, Employee)
' Implementation code
End Class             -(VB.NET) 

A Use the following code:
Dim e1 As Employee, e2 As Employee
e1 = New Employee(1001, "Andy Reid", "Manager")
e2 = New Employee(1002, "Kara Lang", "Sales Engineer")
Dim eData As New EmployeeCollection()
eData.Add(New KeyValuePair(Of String, Employee)(e1.ID, e1))
eData.Add(New KeyValuePair(Of String, Employee)(e2.ID, e2)) 

B Use the following code:
Dim e1 As Employee, e2 As Employee
e1 = New Employee(1001, "Andy Reid", "Manager")
e2 = New Employee(1002, "Kara Lang", "Sales Engineer")
Dim eData As New EmployeeCollection()
eData.Add(DirectCast(e1.ID, String), e1)
eData.Add(DirectCast(e2.ID, String), e2) 

C Use the following code:
Dim e1 As Employee, e2 As Employee
e1 = New Employee(1001, "Andy Reid", "Manager")
e2 = New Employee(1002, "Kara Lang", "Sales Engineer")
Dim eData As New EmployeeCollection()
eData.Add(e1.ID, e1)
eData.Add(e2.ID, e2) 

D Use the following code:
Dim e1 As Employee, e2 As Employee
e1 = New Employee(1001, "Andy Reid", "Manager")
e2 = New Employee(1002, "Kara Lang", "Sales Engineer")
Dim eData As New EmployeeCollection()
eData.Add(New KeyValuePair(e1.ID, e1))
eData.Add(New KeyValuePair(e2.ID, e2)) 

+ Answer
+ Report
Total Preview: 1618

Copyright © 2024. Powered by Intellect Software Ltd