Kotlin TutorialLesson 8Free preview
Kotlin Data Types
This lesson is part of Kotlin · All levels
Summary
This lesson discusses the categories of built-in data types in Kotlin. As a pure object-oriented language, all data types in Kotlin are objects (no raw primitive types are exposed as in Java). Kotlin provides numerical types (Byte, Short, Int, Long, Float, Double), Boolean, Char, and String.
Key points
- All the data types in Kotlin are represented as class objects.
- The standard integer type is 'Int' (32-bit), and for very large numbers 'Long' (64-bit) is used.
- The standard decimal type is 'Double' (64-bit), and 'Float' (32-bit) ends with the letter 'F'
- Conversion of numeric data types does not occur implicitly but must be explicit (e.g.: '.toInt()')
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.