"Java Basics" "Static modification Usage"

Source: Internet
Author: User

In the process of looking at the source code found a particularly strange phenomenon.

It is:

An object in a class that does not declare a class actually uses the method of this class, because the static decorated member variables and member methods can be accessed directly through the class name.

And the only thing to do is to import the class name into it. You do not need to create any objects to use:

Quote a passage from the online excerpt:

“



member variables and member methods that are modified by static are independent of any object of the class. That is, it does not depend on class-specific instances and is shared by all instances of the class.



”

"Java Basics" "Static modification Usage"

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.