Properties of static under multiple units

Source: Internet
Author: User
Tags export class

The static modified method does not have many features, because at this time, the method has no "late binding" nature, that is, the base class reference even point to the export class, the call to the static method or the base class.

If you want to invoke the static method of the exported class, you can only use the Export class's reference (that is, the downward transition).

In fact, Static is implicitly added to the constructor, which is why the derived class can use super () to call the constructor of the base class in the constructor.

Static and variables do not have multiple features, because they are not "late-bound", but "early-bound".

Conditions required for multiple units:

1, the existence of inheritance relations;

2, the export class can override the method of overriding the base class;

3. A reference to the base class points to the object of the exported class and invokes the overridden method.

Note: Variables and static modification methods do not have this property;

The final modified method cannot be overridden and therefore does not have more than one condition;

Private modified variables do not have multiple features, because overridden overrides are not allowed at all (at the same time, the private method has an implicit final modification);

All but static and final (private is a final) can be overridden by overrides;

Properties of static under multiple units

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.