About 1,400,000 results
Open links in new tab
  1. Kotlin: val mutableList vs var immutableList. When to use which?

    Aug 7, 2018 · var - value/reference assigned to a variable can be changed at any point of time. val - value/reference can be assigned only once to a variable and can't be changed later point …

  2. Kotlin Lists: Mutable vs. Immutable | by Thaer Alkhishen - Medium

    Feb 6, 2024 · In Kotlin, collections are categorized into two main types: immutable (read-only) and mutable (modifiable). Understanding the difference is crucial for writing efficient and safe Kotlin...

  3. Kotlin Variables - GeeksforGeeks

    May 10, 2025 · In Kotlin, variables are declared using two types: Immutable is also called read-only variables. Hence, we can not change the value of the variable declared using 'val' …

  4. Kotlin Variables and Data Types - BeginnersBook

    Feb 20, 2019 · There are two types of variables – mutable and immutable. An immutable variable is one whose value cannot be changed, also known as unchangeable or read-only variable. …

  5. Kotlin: val mutableList vs var immutableList. When to use which?

    What is difference between mutable and immutable in Kotlin? Mutable – The contents of the list can be freely changed. Read-Only – The contents of the collection are not meant to be …

  6. Kotlin Variables and Basic Types - DataFlair

    Mutable variables are handy when you need to update or modify the stored data during program execution. Difference between var and val in Kotlin: Variables declared with val are immutable, …

  7. Understanding Kotlin val vs. var: A Quick Comparison

    Dec 11, 2024 · Both val and var can be used as local variables, class properties, or even within functions. The key difference lies in mutability: val means immutable, while var allows …

  8. Understanding `val` and `var` in Kotlin: Immutability and

    Dec 29, 2023 · In Kotlin, the choice between val and var reflects the balance between immutability and mutability. By understanding and leveraging these keywords appropriately, developers …

  9. Is var str: String mutable or immutable? - Stack Overflow

    Jun 17, 2017 · Mutable refers to the value - the data - that the variable points to. Reassignable refers whether you can point a variable to different data (a different value). What's the …

  10. Learn Kotlin: Data Types & Variables Cheatsheet - Codecademy

    A mutable variable is declared with the var keyword and represents a value that is expected to change throughout a program. An immutable variable is declared with the val keyword and …

Refresh