在派生类Visual Basic中的构造函数中增加整数变量

时间:2017-09-21 17:47:38

标签: visual-studio-2012

选项明确开启 选项严格打开 选项推断关闭

Public Class DevelopedPlanetClass

Inherits PlanetClass

Private _GDP As Double
Private _Number As Integer

Public Sub New(DName As String, DNumWages As Integer, DGDP As Double)

    MyBase.New(DName, DNumWages)
    _GDP = DGDP
    _Number += 1 (PROBLEM.... Does not increment when the constructor is called )

End Sub

Public Overloads Function CalcMinWage(GDP As Double) As Double

    Return GDP / _Number

End Function

结束班

0 个答案:

没有答案