What is the difference between auto boxing and coercion?

I program in Java, C, and Python.

The rule for automatic coercion among arithmetic types has been extended to handle a richer set of types

Source: "C Programming Language"

But what does coercion mean? The answers say it looks like type conversion and implicit translations and implicit type conversions, and I call autoboxing, where I read it. So what is the difference between autoboxing and coercion?

thanks

0
source share
3 answers

Coercion is a different name for an implicit type, that is, one specified by the rules of the language, and not explicitly added by the programmer.

+12
source

Coercion is a type of coercion. In other words, you add a variable of type Integer to Float , Integer will be forced to bind to Float , and numbers added together.

+6
source

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

0
source

Source: https://habr.com/ru/post/1237337/


All Articles