Kotlin's Type Inference

Understand Kotlin's powerful type inference capabilities and how to use them to write more succinct code.

We'll cover the following

Type inference is a compiler feature that allows you to omit types in your code when the compiler can infer it for you.

Type Inference in Kotlin #

Kotlin’s compiler can infer the types of most variables, so adding the type is optional:

Create a free account to view this lesson.

Learn to code, grow your skills, and succeed in your tech interview

By signing up, you agree to Educative's Terms of Service and Privacy Policy