OC Base Note-The visibility of member variables (Guangzhou Black horse Phase I)

Source: Internet
Author: User

@private: Private, only the object method in this class can access it directly
A member variable is defined in that class to be used in that class
@protected: Protected: Can only be accessed directly in this class and subclass, no longer externally accessible

@public: Public, everyone can use, in this class, sub-class, external can be accessed

@package: Mainly used within the framework, within the framework equivalent to @protected, outside the frame equivalent to @private (understand)

This class: A class that defines this member variable
Modifier that controls visibility, from the start of use until all member variables end or encounter other control visibility modifiers

The member variable can also be defined within the implementation file, but the member variable is private, and it is private regardless of the visibility modifier used.

OC Base Note-The visibility of member variables (Guangzhou Black horse Phase I)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.