Overview - Type conversion is always explicit
What is it?
Type conversion means changing a value from one type to another, like from a number to a text or from a small number type to a bigger one. In Kotlin, this change never happens automatically; you must always tell the program exactly when and how to convert types. This rule helps avoid mistakes where the program guesses wrong and causes bugs. So, every time you want to convert a type, you write clear code to do it.
Why it matters
Without explicit type conversion, programs might silently change data in unexpected ways, causing errors that are hard to find. By forcing you to write conversions clearly, Kotlin helps you catch mistakes early and keeps your code safe and predictable. This makes your programs more reliable and easier to understand, especially when working with numbers or different data types.
Where it fits
Before learning this, you should understand Kotlin's basic data types like Int, Double, and String. After this, you can learn about Kotlin's type system in more depth, including nullable types and smart casts, which also rely on clear type rules.