How a class refers to a member variable or method of another class

Source: Internet
Author: User
Commonly used are: A class has a variable c,b class want to call C
Method One:
Variable c is non-static (static), then an object of Class A is created in class B, using the object. Variable name.
Method Two:
Variable c is static and is used directly from the class. Variable name


For more information, refer to this library:
Http://wenku.baidu.com/link?url=tyAAmJNGxBnXLnGLDK5of8B23KOMltUXNIA3rpD6U23F460ot_ Y7gvfy51utrku2t6wyzugjx5wodmy623d5pgdwy-wr3ucxzzfvpn5i0e3

How a class refers to a member variable or method of another class

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.