overloading

Computer Science An Overview _J. Glenn *shear _11th Edition_C

Many programming languages allow the use of one symbol to represent more than one operation. In these cases the meaning of the symbol is determined by the data type of the operands. For example, the symbol traditionally indicates addition when its operands are numeric, but in some languages, such as Java, the symbol indicates concatenation when its operands are character strings. That is, the result of the expression

“abra” + “cadabra”

is abracadabra. Such multiple use of an operation symbol is called overloading. While many languages provide built-in overloading of a few common operators,others such as Ada, C++, and C# may allow programmers to define additional overloaded meanings or even add additional operators.

上一篇:让U盘永不中毒的解决办法


下一篇:注解(Annotation)是什么?