# Variables in Kotlin, differences with Java. var vs val (KAD 02)

DevFeed: [Variables in Kotlin, differences with Java. var vs val (KAD 02)](<https://devfeed.tech/articles/variables-in-kotlin-differences-with-java-var-vs-val-kad-02-27232.md>)

Original publisher: [Read original article](<https://antonioleiva.com/variables-kotlin>)

Published: 2016-11-28T00:00:00Z

Content type: tutorial

Language: en

Sources: [Antonio Leiva](<https://devfeed.tech/sources/antonio-leiva.md>)

Topics: [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Java](<https://devfeed.tech/topics/java.md>)

Tags: [java](<https://devfeed.tech/tags/java.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [val](<https://devfeed.tech/tags/val.md>), [var](<https://devfeed.tech/tags/var.md>)

## AI overview

A tutorial chapter explains how variables work in Kotlin and compares Kotlin's val and var declarations with Java. It covers mutable and immutable values, type inference, automatic casting, object types, and explicit numeric conversions.

## Source excerpt

Everything Android, Kotlin and other random topics