Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Prodentim Probiotics Specially Designed For The Health Of Your Teeth And Gums

Instant Grammar Checker - Correct all grammar errors and enhance your writing

Teach Your Child To Read

Powerful WordPress hosting for WordPress professionals

Disclosure: My content contains affiliate links.

31,152 questions

40,706 answers

573 users

How to use class with inheritance in VB.NET

1 Answer

0 votes
Class A
    Public n As Integer

    Public Sub Show()
        Console.WriteLine(n)
    End Sub
End Class

Class B : Inherits A
    Public Sub New(ByVal value As Integer)
        n = value
    End Sub
End Class

Class C : Inherits A
    Public Sub New(ByVal value As Integer)
        n = value
    End Sub
End Class

Module Module1

    Sub Main()

        Dim o1 As B = New B(13)
        o1.Show()

        Dim o2 As C = New C(20)
        o2.Show()

    End Sub

End Module

' run:
' 
' 13
' 20

 





answered Sep 17, 2018 by avibootz

Related questions

1 answer 70 views
1 answer 96 views
1 answer 84 views
1 answer 62 views
1 answer 77 views
...