'VB023类的公有私有
Module Module1
Public Class 人员
Private PName As String
Private Sub Work()
MsgBox("Working", MsgBoxStyle.OkOnly, PName)
End Sub
Public WriteOnly Property Name() As String
Set(ByVal value As String)
PName = value
End Set
End Property
Public Sub SpeakOutName()
MsgBox("My Name Is" & PName, MsgBoxStyle.Information, "人员")
End Sub
Public Sub GotoWork()
MsgBox("On the Way", MsgBoxStyle.OkOnly, PName)
Work()
End Sub
End Class
Public Class 售货员
Inherits 人员
Public Sub SetName(ByVal MyName As String)
Name = MyName
End Sub
End Class
Sub Main()
Dim MrLee As New 售货员()
MrLee.SetName("小明")
本内容试读结束,登录后可阅读更多
下载后可阅读完整内容,剩余1页未读,立即下载