---
title: "Discussion on \"What Is the Difference Between val and var in Kotlin, and Is val Immutable?\" | Hashnode"
description: "Discussion on \"What Is the Difference Between val and var in Kotlin, and Is val Immutable?\". val vs var in Kotlin: why val is read-only and not immutable, how a val can still change, where const val fits, and the StateFlow bug this causes on Android."
url: "https://hashnode.com/posts/kotlin-val-vs-var/6b0b097af40c4446acc9b940"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [What Is the Difference Between val and var in Kotlin, and Is val Immutable?](https://imayankkumar.hashnode.dev/kotlin-val-vs-var?utm_source=hashnode&utm_medium=feed)

val vs var in Kotlin: why val is read-only and not immutable, how a val can still change, where const val fits, and the StateFlow bug this causes on Android.

Nov 28 · 8 min read · imayankkumar.hashnode.dev  
Read the article

-   [#kotlin](https://hashnode.com/tag/kotlin)
-   [#android](https://hashnode.com/tag/android)
-   [#android-app-development](https://hashnode.com/tag/android-app-development)
-   [#programming-basics](https://hashnode.com/tag/programming-basics)

## Written by

[Mayank Kumar](https://hashnode.com/@imayankkumar)

@imayankkumar · Bengaluru, India

  
[View profile](https://hashnode.com/@imayankkumar)

Senior Android Engineer | Kotlin, Android Internals, Performance Engineering & AI

I'm Mayank, an Android engineer focused on Kotlin, software architecture, performance engineering, and AI-assisted development. I write about building Android apps with AI, including the experiments that don't work.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
