Differences between public and private

zhaozj2021-02-11  208

Differences between public and private

The meaning of public public in English is: a total, public meaning; private meaning is: private, private meaning. However, what are their differences in programming? Let's take a look at the meaning of Public: Since his meaning is a common, public, it indicates that it is used in public cases, which is available for any form and process call. It is used by public functions, the process, etc., and the range is large. Look at the meaning of Private: Its use is to define a private function, use, the function it defines, the process is only used in it, and the range is smaller. Some people can't help but ask: Since there is a function of public definitions, the process, what is the trivate defined? In fact, the function of public definitions, the biggest disadvantage is that it is easy to be accessible by other programs and code, which is not conducive to its confidentiality, and Private definitions have a great guarantee for security and confidentiality. However, in a generally small VB program, call the API function is using the module to use public, without using the module, it is changed to private, there is not much difference. If you operate on a large program or to operate the inside of the operating system, you should pay attention to it. All in all, reasonable use of public and private is good. Not only can I improve the running speed of the program, but it is more important to improve the reliability of the program.

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

New Post(0)