liveBook · Manning

Implicit conversion

Implicit conversion is an automatic change of a value from one type to another according to language rules, without an explicit conversion operation in the source code.

How 4 Manning books explain it

100 Java Mistakes and How to Avoid Them

Implicit conversion is an automatic type conversion performed by Java according to its conversion rules without an explicit cast or conversion call.

How it is used
Prevents expression, numeric, and generic-type bugs caused by Java conversions that occur without explicit casts.
How deep it goes
Explains conversion consequences through concatenation, conditional expressions, compound assignments, and erased generics, with avoidance guidance and inspection limits.
Examples
Uses `"Entry#" + index + 1`, `char c *= 1.2`, byte updates and shifts, and a `List<String>` read.
What you can do after
Diagnose/debug with it by spotting hidden string, numeric, and generic casts and choosing explicit safer alternatives.

Read how 100 Java Mistakes and How to Avoid Them explains implicit conversion →

100 C++ Mistakes and How to Avoid Them

An automatic conversion performed by C++ without an explicit cast or conversion request in the source code.

How it is used
Uses implicit conversion to explain hidden readability, correctness, and performance costs in class operations and legacy modernization.
How deep it goes
Explains conversion constructors, conversion operators, temporary construction, and explicit alternatives, but does not develop the full conversion-rule system.
Examples
Demonstrates Circle construction, Rational output and comparison, and Complex arithmetic that silently creates converted operands and temporaries.
What you can do after
Diagnose hidden conversions and reduce them with explicit constructors, named conversion functions, or type-specific operator overloads.

Read how 100 C++ Mistakes and How to Avoid Them explains implicit conversion →

Modern C, Third Edition

An implicit conversion is an automatic C conversion that changes a value from one type to another according to the language's conversion rules.

How it is used
Explains how C supplies required types for initialization, assignment, function arguments, and arithmetic expressions.
How deep it goes
Works through promotions and arithmetic rules, stopping short of a complete conversion table while flagging platform-dependent and precision-losing cases.
Examples
Uses integer and floating initializations, hexadecimal and decimal literals, mixed-sign comparisons, cosf, printf, and complex arithmetic.
What you can do after
Evaluate C expressions and conversions for preserved values, information loss, implementation-defined behavior, signedness hazards, and precision loss.

Read how Modern C, Third Edition explains implicit conversion →

Modern C

An implicit conversion is an automatic C conversion that changes a value from one type to another without an explicit cast.

How it is used
Uses automatic type changes to explain assignments, operators, comparisons, arithmetic, and restricted pointer interactions.
How deep it goes
Explains value fitting, literal typing, signedness, precision loss, implementation-defined results, and pointer restrictions through worked examples.
Examples
Uses typed initializations, hexadecimal literals, mixed-sign comparisons, pointer assignments, and byte inspection of an unsigned integer.
What you can do after
Evaluate conversion safety by checking value ranges, operand signedness, precision, pointer compatibility, and whether behavior is implementation-defined or undefined.

Read how Modern C explains implicit conversion →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.