Conclusion

Heads up... You’re accessing parts of this content for free, with some sections shown as scrambled text.

Heads up... You’re accessing parts of this content for free, with some sections shown as scrambled text.

Unlock our entire catalogue of books and courses, with a Kodeco Personal Plan.

Unlock now

In this lesson, you learned about the following topics:

  • The null value concept and its purposes
  • The differences between nullable and non-nullable types
  • null safety and null checks
  • null-related operators like safe call, Elvis operator, not-null assertion operator and safe cast operator
  • Platform types and how to handle them in Kotlin.

The null value is a powerful thing. It allows you to express the absence of data. In Kotlin, you have a variety of tools to handle the null values safely. As a last resort, you can use the not-null assertion operator but you should use it with caution. It bypasses the null checks. Be careful when using the Java APIs in your Kotlin projects. The Kotlin compiler does not enforce any null checks on the Java platform types.

You reached the end of the lesson and the module. Congratulations! You’ve learned a lot about Kotlin language basics. In the next module, you’ll learn about the Kotlin objects. See you there!

See forum comments
Download course materials from Github
Previous: Demo Next: Quiz: Work with Null Values