vb.net类的属性,函数与继承的学习

Public Class Customer
    Public Sub New()
        Debug.WriteLine("setuped")

    End Sub

    '--------New(Byval)---------
    Public Sub New(ByVal sname As String)
        Name = sname
        Debug.WriteLine(Name & "setuped")
    End Sub

    Private m_Name As String
    Property Name() As String
        Get
            Return m_Name
        End Get
        Set(ByVal Value As String)
            m_Name = Value
        End Set
    End Property
    Private m_address As String
    Property Address() As String
        Get
            Return m_address
        End Get
        Set(ByVal Value As String)
            m_address = Value
        End Set
    End Property

    Public Function PlaceOrder() As String

    End Function

    Public Function CheckOrderStatus() As String

    End Function

    Public Overridable Function CalculateDiscount() As String
        Return "base class"
    End Function
End Class
-----------------------------------------------------------------------------

 Public Class SubPro : Inherits Customer

    Private m_zfjg As String
    Property Zfjg() As String
        Get
            Return Zfjg
        End Get
        Set(ByVal Value As String)
            m_zfjg = Value
        End Set
    End Property

    Private m_bsc As String
    Property Bsc() As String
        Get
            Return m_bsc
        End Get
        Set(ByVal Value As String)
            m_bsc = Value
        End Set
    End Property

    Public Overrides Function CalculateDiscount() As String
        Return "sub class"
    End Function
    Public Function SubProSelf() As String

    End Function
    Public Sub New()
        MyBase.New()
    End Sub
End Class

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值