Access control refers to the access attributes of members in the class. VB. NET has several access control levels, which are listed in Table 3-7.
Table 3-Access Control for Class 7 members
Access control level description
There is no access restriction for Public class members. To construct a public class member, you can use the public keyword before the class member name to access the public member. For example, the PrintSalary method in the Employee class is a public method that can be called by anyone and functions.
Private class members can only be accessed within the class. Private Key words are used to declare Private class members.
Protected protects members from being accessed by class members and their inherited classes. Use the keyword Protected to define the Protected members.
Friend meta access is restricted in programs that declare this type, and a Friend Meta is declared using the keyword "Friend ".
Combination of Protected friend protected and friend
| BibliographyPrevious sectionNext section |