Operator (computer programming): Difference between revisions

Content deleted Content added
m sharper cat
Cookman (talk | contribs)
No edit summary
Line 7:
In some programming languages an operator may work with more than one kind of data, (such as in [[Java programming language|Java]] where the <tt>+</tt> operator is used both for the addition of numbers and for the concatenation of strings). Such an operator is said to be ''overloaded''. In languages that support [[operator overloading]] by the programmer, such as [[C Plus Plus|C++]], one can define customized uses for operators; in [[Prolog]], one can also define new operators.
 
Some languages also allow for the operands of an operator to be of different data types, in which case one of them is ''coerced'' to the data type of the other, to permit the operation to occur. For example, in [[Perl]] <tt>12 + "3.14"</tt>, causes the text <tt>"3.1415914"</tt> to be coerced to a number and produces the result <tt>15.14</tt>.
 
{{comp-stub}}