Vous êtes sur la page 1sur 2

Class staf

Protected staffid As String


Protected name As String
Protected salary As Double
End Class
Class teacher
Inherits staf
Private Cl As String
Private form As String
Public Sub New(ByVal x As String, ByVal y As String, ByVal z As Double, ByVal a As String, ByVal b As
String)
staffid = x
name = y
salary = z
Cl = a
form = b
End Sub
Public Sub show()
Console.WriteLine(staffid)
Console.WriteLine(name)
Console.WriteLine(salary)
Console.WriteLine(Cl)
Console.WriteLine(form)

End Sub

End Class
Class supportstaf
Inherits staf

Private type As String


Private dept As String
Public Sub New(ByVal x As String, ByVal y As String, ByVal z As Double, ByVal a As String, ByVal b As
String)
staffid = x
name = y
salary = z
type = a
dept = b
End Sub
Public Sub show()
Console.WriteLine(staffid, name, salary, type, dept)
End Sub

End Class
Sub Main()
Dim x As teacher = New teacher("23dd2", "ali", 22.4, "6b", "3d")
x.show()
Console.ReadLine()
End Sub

Vous aimerez peut-être aussi