What is the difference between overloading and rewriting in java

王林
Release: 2020-04-30 17:11:36
forward
2568 people have browsed it

What is the difference between overloading and rewriting in java

Difference:

Method overloading is a class that defines multiple methods with the same name, but the number of their parameters is different or the number is the same but the type and order are different. .

Method overriding is a method in which the method in the subclass has the same name as the method in the parent class, and the number and type of parameters are the same, and the return value is also the same.

(Recommended video tutorial:java video)

As shown below:

What is the difference between overloading and rewriting in java

Recommended tutorial:Java entry program

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

Related labels:
source:cnblogs.com
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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!