Public Class MyType(Of T, U)
Private _myFirstDataMember As T
Private _mySecondDataMember As U
Public Sub New(ByVal val1 As T, ByVal val2 As U)
Me._myFirstDataMember = val1
Me._mySecondDataMember = val2
End Sub
Public Function GetFirstDataMember() As T
Return Me._myFirstDataMember
End Function
Public Function GetSecondDataMember() As U
Return Me._mySecondDataMember
End Function
End Class
Public Class MyApp
Shared Sub Main()
Dim testType As New MyType(Of String, String)("val1", "Val2")
Console.WriteLine(testType.GetFirstDataMember())
Console.WriteLine(testType.GetSecondDataMember())
End Sub
End Class
|