"Java Programming thought" study notes--the eighth chapter polymorphism

Source: Internet
Author: User

In object-oriented programming language, polymorphism is the third basic feature following data abstraction and inheritance.

Polymorphism does what and how by separating, separating the interface from the implementation from another angle. Polymorphism can not only


Method call Binding

Associating a method call with the same method body is called a binding. Binding (implemented by the compiler and the linker, if any) before the program executes is called early binding.

Late binding: Binds at run time based on the type of the object. Late binding is also known as dynamic binding or runtime binding.

In addition to the static method and the final method in Java (the private method belongs to the final method), all other methods are late-bound. This means that in general, we don't have to decide whether late binding should occur----It happens automatically

Private method (private default is final), domain, static methods are not polymorphic, polymorphic only for common methods. The constructor (which is actually the static method) is also not polymorphic.


This article is from the "Small City Ops" blog, please be sure to keep this source http://lixcto.blog.51cto.com/4834175/1896059

"Java Programming thought" study notes--the 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.