◆→"重载"一词是否有两个以上的意思?
另一个重载是指操作符重载,在类内部对内建的操作符进行重定义:
With C++, you can redefine the function of most built-in operators. These operators can be redefined, or “overloaded,” globally or on a class-by-class basis. Overloaded operators are implemented as functions and can be class-member or global functions.
那么上面就有两层意思了:
1.在“相同”或“同一”或“same”的作用域内同一名称不同函数的现象称为重载,比如一个类内部有两个构造函数。
2.在一个大的作用域内包含的另一个小的作用域内,对大作用域的某个函数、运算符进行重定义的现象。
还有一个经常被人称为“重载”的意思就是:比如“重载基类的虚函数”中的“重载”。这里的重载其实是实现的意思;如果该虚函数贯穿的不只一个派生层次,其实也可以理解为“重定义”,即将父类中该函数的实现覆盖掉,重新写一个。那么这里的重载其实是描述“多态”的一个术语。
于是“重载”一词至少应当有三个意思。是吗?如果有面试官问:“什么是重载?”该作何回答?
如果我理解的概念有误,急盼指出,多谢!
相关推荐
java_jdk-8u161-windows-x64(jdk官方版本1.8)
官方下载的java jdk1.8官方版本 在官网加载速度很慢,CSDN下载速度很快。
JDK1.8-windows-x64(官方WINDOW正式版)
The JDK is a development environment for building applications using the Java programming language. The JDK includes tools useful for developing and testing programs written in the Java programming language and running on the JavaTM platform. WARNING: These older versions of the JRE and JDK are provided to help developers debug issues in older systems. They are not updated with the latest security patches and are not recommended for use in production. For production use Oracle recommends downloading the latest JDK and JRE versions and allowing auto-update. Only developers and Enterprise administrators should download these releases. Downloading these releases requires an oracle.com account. If you don't have an oracle.com account you can use the links on the top of this page to learn more about it and register for one for free.
JDK1.8 64位 Windows 官方正式版(jdk-8u261-windows-x64)
Java SE 8u261 is the latest release for the Java SE 8 Platform JDK1.8 64位 Windows 官方正式版(jdk-8u261-windows-x64)
jdk-8u151-windows-x64.exe 【官方下载的jdk1.8、jdk8,windows 64位版】
jdk-8u151-windows-x64.exe 【官方下载的jdk1.8、jdk8,windows 64位版】。
jdk1.8(windows-x64-8u271).zip
官方下载的JDK1.8。版本:windows-x64-8u271


