Introduction

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

Have you ever heard of the billion-dollar mistake in software programming? It refers to the null type, which is common to most programming languages. Yet, each language treats it differently. Well-designed programs can make good use of nulls as it could be the best way to represent a certain state.

But, if not handled properly, a null value could lead to undesirable outcomes. This isn’t a far-fetched scenario. It happens to many programmers and in many projects, but especially as you’re starting out. Recently, many programming languages have introduced mechanisms to help better address nulls. Kotlin has had this feature from the very beginning.

In this lesson, you’ll learn about:

  • The concept of null.
  • How to define variables as nullable.
  • How to work with nullable variables in code.
See forum comments
Download course materials from Github
Previous: Learn the Kotlin Language: Discover Operators Next: Instruction 1