Public Class Employees
Private mIntID As Integer
Private mStrName As String
Public Property GetID() As Integer
Get
Return mIntID
End Get
Set(ByVal value As Integer)
mIntID = value
End Set
End Property
Public Property GetName() As String
Get
Return mStrName
End Get
Set(ByVal value As String)
mStrName = value
End Set
End Property
End Class
Public Class HRDEmployees
Inherits Employees
Public Sub New()
End Sub
Public Sub New(ByVal ID As Integer)
MyBase.GetID = ID
End Sub
Public Sub New(ByVal Name As String)
MyBase.GetName = Name
End Sub
Public Sub New(ByVal ID As Integer, ByVal Name As String)
MyBase.GetID = ID
MyBase.GetName = Name
End Sub
End Class
Sub Main()
Dim HRDEmp1 As New HRDEmployees()
HRDEmp1.GetID = 1
HRDEmp1.GetName = "Roel"
Dim HRDEmp2 As New HRDEmployees(2)
HRDEmp2.GetName = "Yulian"
Dim HRDEmp3 As New HRDEmployees(3, "Rully Yulian")
Console.WriteLine(HRDEmp1.GetID & "," & HRDEmp1.GetName)
Console.WriteLine(HRDEmp2.GetID & "," & HRDEmp2.GetName)
Console.WriteLine(HRDEmp3.GetID & "," & HRDEmp3.GetName)
Console.ReadLine()
End Sub
Comments