From the course: Build Spring Boot Apps with the Kotlin Programming Language

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

Chapter review

Chapter review

- [Instructor] Okay, well I think that's enough about data types in Kotlin, for now, at least. We've actually covered quite a lot in this chapter. We saw that there are no literals in Kotlin or the data types are of the object data type. That's double with a capital D or int with a capital I. Although they could be compiled to a Java literal when it's compiled to byte code on the JVM. We saw that on Kotlin the integer is called int, not integer. We saw that variables cannot be used until a value has been assigned to them. So you can declare a variable but you cannot reference it until a value has been assigned. We saw smart casting, that's if you're using an if statement and you're doing a type check within your ref statement then you don't have to cast, it's done automatically for you. But in those times when you do have to cast, we use the as keyword. Okay? Well, I mentioned the dreaded word null earlier on in this chapter and actually, so far we haven't tried to set any variable to…

Contents