[VB.NET] Inheritance Class


Deskripsi
     example Inheritance vb.NET and the relation between (access level)

Howto
Access property : 1. Public : can access anywhere , any assembly
                            2. Private : only current class can use it, inheritance not allowed , current assembly
                            3. Protect : only current class and inheritance allowed
                            4. Friend : can access anywhere , but only current assembly
                            5. Friend Protect : only current class, current assembly and inheritance allowed

class1
    public sub helloworld()
          messagebox.show "this is class 1"
    end sub
end class

-------------------------------------------------------------

class 2
    inheritance class1
 
    public sub methodclass2()
          messagebox.show "this is class 2"
          helloworld() 'inheritance from class 1
    end sub
end class


Post a Comment

Harap gunakan bahasa yang baik dan sopan, terima kasih