# Nulls and Null Safety

DevFeed: [Nulls and Null Safety](<https://devfeed.tech/articles/nulls-and-null-safety-25061.md>)

Original publisher: [Read original article](<https://typealias.com/start/kotlin-nulls/>)

Author: author@typealias.com (Dave Leeds)

Published: 2021-03-30T00:00:00Z

Content type: tutorial

Language: en

Sources: [Dave Leeds on Kotlin - typealias.com](<https://devfeed.tech/sources/dave-leeds-on-kotlin-typealias-com.md>)

Topics: [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Jetpack Compose](<https://devfeed.tech/topics/jetpack-compose.md>)

Tags: [elvis-operator](<https://devfeed.tech/tags/elvis-operator.md>), [introduction](<https://devfeed.tech/tags/introduction.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [learn-to-program](<https://devfeed.tech/tags/learn-to-program.md>), [not-null-assertion-operator](<https://devfeed.tech/tags/not-null-assertion-operator.md>), [null](<https://devfeed.tech/tags/null.md>), [null-safety](<https://devfeed.tech/tags/null-safety.md>), [optional](<https://devfeed.tech/tags/optional.md>), [programming](<https://devfeed.tech/tags/programming.md>), [safe-call-operator](<https://devfeed.tech/tags/safe-call-operator.md>), [smart-cast](<https://devfeed.tech/tags/smart-cast.md>)

## AI overview

An introduction to nulls and null safety in Kotlin, explaining that variables may not always hold a value and setting up a coffee-rating example implemented in Kotlin.

## Source excerpt

So far in this book, every time that we created a variable, whether it was a String, an Int, or a Boolean, we assigned a value to it. There are times, though, when we need to create a variable that might not actually hold a value! This brings us to the exciting topic of nulls! Introduction to Nulls James has set up a coffee stand downtown, and he's ready to start sharing his fine brew!