Static cannot coexist with This,super (Java)

Source: Internet
Author: User

As is known to all, static, unchanging

Static in Java modifies a member property, which means that the property/method can be called directly by a class name, such as a tool class

This represents a reference to this class of objects, usually with the name of a member variable and a local variable.

Super represents the initialization of a subclass on a parent class full parameter constructor, which is also required to produce an object to use

However, given that the virtual machine is loaded in order to load the class first, the object is generated when it is instantiated.

So if coexistence means that classes and objects are loaded at the same time, it is clearly illogical.

Personal understanding, if there is objection, listen to the advice

Static cannot coexist with This,super (Java)

Related Article

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.