What is the difference between autoboxing and coercion?

Niklas R. picture Niklas R. · Jun 18, 2012 · Viewed 8.4k times · Source

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

Answer

Alnitak picture Alnitak · Jun 18, 2012

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