We break down type conversions in Java: automatic (widening) and explicit (narrowing) casts between
int,
double,
long,
byte,
char, rules for mixed expressions, transitions between numbers and strings using
Integer.parseInt and
Integer.toString, and how a cast (
(
int
)) differs from rounding via
Math.round. With practical examples and typical mistakes.