Overload: In the same class, the function name, return value or parameter type, the number of different is called overload.
Overwrite: A function with the same name, with the return value type, called overlay. refers to the child class's overwrite
Overload of a method
Method name, but the parameter is different, this is the overload (overload).
The so-called parameters are not the same, there are two main points: first, the number of parameters is not the same, the second is the type of
What is polymorphism?
Polymorphism (polymorphism) literally means "multiple states." In object-oriented languages, many different implementations of interfaces are polymorphic. Citing Charlie Calverts's description of polymorphism-polymorphism is a
Object overload technology is introduced in PHP 5, and the possibility of overloading the method __call (), __set () and __get () is discussed in this article. After a brief introduction to the overload theory, we will get to the topic through two
Overload: As the name implies, it is over (re)--load (load), so Chinese names are overloaded.It can express the polymorphism of the class, can be the function inside can have the same function name but the parameter name, return value, type can not
Method overload
The same function can be applied to various types of data. It declares more than two methods with the same name to achieve the same processing for different data types.
Method overload requirements
1. The names of the overloaded
A lot of students for overload and override silly points, suggest not to rote conceptual knowledge, to understand to remember.
First give me the definition:
overload (Overload): A group of methods that have the same name and different parameters
This article introduces how to introduce and differentiate overload, override, and hide. If you need it, you can refer to it.
These three concepts are related to polymorphism in OO. It is easier to distinguish between overload and coverage, but
Overload and override in PHP and JAVA. Overload: in the same class, function names are the same, return values or parameter types, and different numbers are called overload. Overwrite: a function with the same name. it is of the same return value
Java override (Override) vs. overload (overload)
Override (Override)Overrides are subclasses that rewrite the implementation of the method that allows access to the parent class, and the return value and formal parameters cannot be changed.
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.