Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

重载和重写的区别解析 | Jordan Zhang随记 #11

Open
JordanHank opened this issue Feb 26, 2020 · 0 comments
Open

重载和重写的区别解析 | Jordan Zhang随记 #11

JordanHank opened this issue Feb 26, 2020 · 0 comments

Comments

@JordanHank
Copy link
Owner

https://jordanzhang.xyz/2018/10/12/%E9%87%8D%E8%BD%BD%E5%92%8C%E9%87%8D%E5%86%99%E7%9A%84%E5%8C%BA%E5%88%AB%E8%A7%A3%E6%9E%90/

java三大特性:封装、继承和多态。而多态就是通过重载和重写实现的,所以理解重载和重写的区别,更有利于对java多态的应用。 重载Overloading重载是编译发生的多态性,同一个类中如果有多个同名方法,而返回类型或者参数列表不同叫做重载。在类编译加载时是通过参数列表的不同区分同名方法的,所以重载方法的参数列表必须不同,可以是参数个数不同,也可以是参数类型不同,返回值可以相同也可以不同,并不能以

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant