Kotlin Fundamentals: Primitive Types, Control Structures, and Jump Expressions
Numeric Types
Kotlin supports Java 8's underscore notation for numeric literals to improve readability:
val million = 1_000_000
val creditCardNumber = 1234_5678_9012_3456L
Type Suffixes and Explicit Type Declaration
To specify numeric types explicitly, use type annotations or suffixes:
val floatValue: Float = 1 // Using type annotation
v ...
Posted on Thu, 04 Jun 2026 16:05:40 +0000 by BobcatM