VB.Net Program to Demonstrate the Multiple-Inheritance Using Interface and Structure

You are currently viewing VB.Net Program to Demonstrate the Multiple-Inheritance Using Interface and Structure

VB.Net program to demonstrate the multiple-inheritance using interface and structure

'VB.net program to demonstrate the multiple-inheritance 
'using interface and structure.

Module Module1
    Interface ISample1
        Sub Fun1()
    End Interface

    Interface ISample2
        Sub Fun2()
    End Interface

    Interface ISample3
        Sub Fun3()
    End Interface


    Structure Sample
        Implements ISample1, ISample2, ISample3

        Sub Fun1() Implements ISample1.Fun1
            Console.WriteLine("Fun1() called inside the structure")
        End Sub
        Sub Fun2() Implements ISample2.Fun2
            Console.WriteLine("Fun2() called inside the structure")
        End Sub
        Sub Fun3() Implements ISample3.Fun3
            Console.WriteLine("Fun3() called inside the structure")
        End Sub
    End Structure

    Sub Main()
        Dim S As New Sample()
        S.Fun1()
        S.Fun2()
        S.Fun3()
    End Sub
End Module

Output

Fun1() called inside the structure
Fun2() called inside the structure
Fun3() called inside the structure
Press any key to continue . . .

Ranjith Kumar

Hi, I'm Ranjith a full-time Blogger, YouTuber, Affiliate Marketer, & founder of Coding Diksha. Here, I post about programming to help developers.

Leave a Reply