Public

The public access specifier means that there is no limitation to access the entity being modified. If a class or member is set as public, it can be accessed by other classes or programs in the same assembly, other assemblies, and even other programs that are installed in the operating system that the program is running in. Normally, the starting point of an application or main method is set as public, meaning that it can be accessed by others. To make a class public, you just need to put a public keyword before the keyword class, as shown in the following code:

public class Animal {
}

The preceding Animal class can be accessed by any other class, and as the member Name is also public, it can also be accessed from any location.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.138.69.85