Home > Java > javaTutorial > What is polymorphism in java

What is polymorphism in java

云罗郡主
Release: 2018-12-01 11:35:34
Original
13920 people have browsed it


#What is the polymorphic implementation mechanism? Many people don't know what polymorphism is in Java? This article will explain to you what polymorphism is in Java?

What is polymorphism in javaWhat is polymorphism in java?

Java polymorphism means that the same behavior has many representation forms. We know that triangle is a form and quadrilateral is also a form. Polymorphism here is actually a port. The emergence of polymorphism is actually the right The embodiment of various port forms.

What are the advantages of java polymorphism?

Java has many advantages. First of all, it has many interfaces, has a certain degree of flexibility and simplification, and can eliminate the coupling relationship between types. It is replaceable and has good program scalability.

What is polymorphism in java

#What are the three conditions for the existence of polymorphism?

First of all, there must be inheritance, secondly there must be overriding, and thirdly, the parent class references the child class object. When we use polymorphism to call a method, we must first check the parent class Has this method been used? If it does not appear, it means a compilation error. If it does, it means that the subclass method can be called.

The above is a complete introduction to what polymorphism is in java. If you want to know more about java tutorial, please pay attention to the php Chinese website.



The above is the detailed content of What is polymorphism in java. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template