This chapter is largely devoted to the fundamental building blocks that are core elements of the Kotlin programming language. Each one may seem insignificant by itself, but combined together, they create really powerful language constructs. We will discuss the Kotlin type system that introduces strict null safety and smart casts. Also, we will see a few new operators in the JVM world, and many improvements compared to Java. We will also present new ways to handle application flows and deal with equality in a unified way.
In this chapter, we will cover the following topics:
- Variables, values, and constants
- Type inference
- Strict null safety
- Smart casts
- Kotlin data types
- Control structures
- Exceptions handling