What does the "static" keyword mean? Is it possible to overwrite (override) a private or static method in Java?

Source: Internet
Author: User
Tags inheritance

Static is the meaning of statics, which can be used to modify member variables and member functions, which are statically decorated member functions that only access static members and cannot access non-static members. Static is loaded as the class loads, so it can be accessed directly from the class.

Overrides, also known as Overrides, are the same way that a method in a subclass inherits from a subclass in a parent class (the function name, parameter type, parameter, return value type), but the subclass does not have access rights lower than the parent class. The overriding premise is that inheritance must be inherited, and the private adornment does not support inheritance, so it cannot be overridden by proprietary methods. Static methods can be overridden, that is, a subclass can override static methods in the parent class, but in fact the static method is not overridden in the memory perspective.

What does the "static" keyword mean? Is it possible to overwrite (override) a private or static method in 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.