What is diffrences Sub and public sub on Vb.net ?
(I'm using Visual Studio 2012)
my teacher asked me and i searched google i just found difference between Private Sub, Function and Class
Thanks for your help
What is diffrences Sub and public sub on Vb.net ?
(I'm using Visual Studio 2012)
my teacher asked me and i searched google i just found difference between Private Sub, Function and Class
Thanks for your help
Copyright © 2021 Jogjafile Inc.
The
Publickeyword is an access modifier. It states that every code that has a reference to the module or class where the sub is declared have access to it. There are several access modifiers you can use in VB.Net -Public,Friend,Protected,Protected FriendorPrivate, each one indicates a different access level:Public: Available to everyone.Friend: Available only inside the current assembly.Protected: Available only to classes inheriting the current class.Protected Friend: Available only to inheritors or inside the current assembly. It's basically a combination of Protected and Friend.Private: Available only inside your Class or Module.Of course, everything is available in the current Class or Module, regardless of it's access modifier.
You can read all about it in details in the relevant MSDN page.