Class boundary (Java access control)

xiaoxiao2021-03-06  42

Public, private, protected, and hintful Friendly. Java controls the object with these three keywords, making the overall development of the program more orderly, improving security, easy to develop, so that the entire environment will grow long as the development time, the programmer is increasing, will not change It is getting worse.

PUBLIC, as the name implies. Private, private, only the consequences of this class function and class of the class have the right to use, the consequences of illegal access are returning a compilation error. protected, protected. (An inherited class can access Protected members, but you can not access the private member)

转载请注明原文地址:https://www.9cbs.com/read-51414.html

New Post(0)