G
Guest
hey all,
i saw this example and had a question:
Imports System
Namespace MySpace
Public Class Foo : Inherits Bar
Dim x As Integer
Public Sub New()
MyBase.New()
x = 4
End Sub
Public Sub Add(x As Integer)
Me.x = Me.x + x
End Sub
Overrides Public Function GetNum() As Integer
Return x
End Function
End Class
End Namespace
' vbc /out:libraryvb.dll /t:library
' library.vb
Does this mean that if this class gets instantiated there will be 2 objects
because of the MyBase.New line? what would be the reasons for using the line
mybase.new?
thanks,
rodchar
i saw this example and had a question:
Imports System
Namespace MySpace
Public Class Foo : Inherits Bar
Dim x As Integer
Public Sub New()
MyBase.New()
x = 4
End Sub
Public Sub Add(x As Integer)
Me.x = Me.x + x
End Sub
Overrides Public Function GetNum() As Integer
Return x
End Function
End Class
End Namespace
' vbc /out:libraryvb.dll /t:library
' library.vb
Does this mean that if this class gets instantiated there will be 2 objects
because of the MyBase.New line? what would be the reasons for using the line
mybase.new?
thanks,
rodchar