Need Assistance?

support@tutorialshub.in

Variables, Data Types & Operators

Type Inference & Explicit Conversions

ADVERTISEMENT
Kotlin Free Lesson
5 min read
ADVERTISEMENT

Kotlin does not implicitly widen numbers (unlike Java, assigning an Int to a Long variable directly is a compile error). Always call explicit conversion methods like .toLong(), .toDouble(), or .toIntOrNull().

ADVERTISEMENT
Hi, I'm Tuby! Here to help you