In this chapter, we have seen how Kotlin handles nulls and the various means by which we can access nulls safely, such as the Elvis operator and Optional. In addition, runtime reflection was introduced to show how code can be inspected at runtime, including accessing functions, classes and constructors dynamically. Finally, we saw several useful Kotlin annotations and their effect on the compiler.
In Chapter 8, Generics, we will begin a discussion on Kotlin's advanced type system and how we can write generic code.