Public Class CBaseHenry
Private x As Integer = 10
Protected y As Integer
Sub New()
Console.WriteLine("基类的构造")
End Sub
Protected Overrides Sub Finalize()
Console.WriteLine("基类的析构")
MyBase.Finalize()
End Sub
Public Overridable Function GetY(ByVal x As Integer) As Integer
Me.y = me.x + x ‘private类型的me.x只能在基类中使用
Console.WriteLine("基类的GetY方法,结果为:" & Me.y)
Return Me.y
End Function
Public Sub OldY()
Console.WriteLine("基类的OldY方法")
End Sub
End Class
| 广告合作:400-664-0084 全国热线:400-664-0084 Copyright 2010 - 2017 www.my8848.com 珠峰网 粤ICP备15066211号 珠峰网 版权所有 All Rights Reserved
|