Types

A detailed explanation of the problems int the Java type system, and how Kotlin fixes them using Any, Unit and Nothing.

Gabriel Shanahan
The Kotlin Primer
Published in
10 min readSep 11, 2022

--

— — — — — — — — — — — — — — —

THE CURRENT VERSION OF THIS ARTICLE IS PUBLISHED HERE.

— — — — — — — — — — — — — — —

Tags: #FYI #FUNDAMENTAL CONCEPT

This article is part of the Kotlin Primer, an opinionated guide to the Kotlin language, which is indented to help facilitate Kotlin adoption inside Java-centric organizations. It was originally written as an organizational learning resource for Etnetera a.s. and I would like to express my sincere gratitude for their support.

It is recommended to read the Introduction before moving on. Check out the Table of Contents for all articles.

The topic of types can be confusing to newcomers, and I don’t want to bog you down with the details when you’re just starting to learn. However, it is still important to understand what’s really going on. Therefore, I split this section into two parts.

Definitely read this

Tags: #FYI

  • Kotlin does not have primitive types — everything is an object…

--

--