Frage

I program in Java, C and Python.

The rule for automatic coercions among arithmetic types have been augmented to handle the richer set of types

Source: "The C Programming Language"

But what does "coercion" mean? The answers say it's like type conversion and implicit casts and implicit type conversions and called autoboxing where I read it. So what is the difference between automboxing and coercion?

Thanks

War es hilfreich?

Lösung

Coercion is another name for an implicit type cast, i.e. one mandated by the language rules, and not explicitly added by the programmer.

Andere Tipps

Coercion refers to "type coercion". In other words, you add a variable of type Integer to a Float, the Integer will be coerced to Float, and the numbers added together.

Coercion is the process of changing one data type into another. http://en.wikipedia.org/wiki/Type_conversion

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top