The Java programming thought note Eighth chapter polymorphism

Source: Internet
Author: User

1. Upward transformation
    • The handle class reference is treated as a parent class reference. (The subclass object is assigned to the parent class reference)
2. Binding
    • Determines which class the method belongs to.
3. Early binding
    • The program is bound before execution.
4. Late binding is also called dynamic binding
    • The program is run-time bound.
5. Constructors and polymorphic

5.1 Domains and static methods (including constructors) are not polymorphic.

5.2 Constructors can be polymorphic, calling methods that are overridden in subclasses, but not secure.

5.3 Methods within a constructor can be safely called only the final method of the base class.

Knowledge points
    • Private methods are overwritten and are independent of the base class, and new methods that belong to the subclass are just the same as the base class private methods.
    • The cleanup order is the opposite of the initialization order.
    • This represents a reference to this object.
    • In addition to the final static private method, the other methods are dynamic bindings.
    • Compilation compiles Java files into class files, each of which is a class file, including an inner class. The first time the class file is loaded with code, the class file is loaded only once.

The Java programming thought note Eighth chapter polymorphism

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.