V
Vinsoft Lab
Learn • Build • Grow
Mobile Development Intermediate Paid

Kotlin Mobile Development

Learn Kotlin from the fundamentals to object-oriented programming, collections, null safety, functions and Android development foundations.

10 Weeks 24 Lessons Android Development Foundation
Your Progress 0%
LESSON 4

Variables with val and var

Learn the difference between immutable val variables and mutable var variables.

Kotlin Code

Study the example and understand each part.

KOTLIN
fun main() {

    val school = "Vinsoft Lab"

    var students = 50

    students = 75

    println(school)
    println(students)

}

Kotlin is commonly developed using Android Studio or IntelliJ IDEA. These examples can be used as a foundation for Android application development.

Key Concept

Use val when a reference should not be reassigned and var when its value needs to change.

Expected Output / Result

Vinsoft Lab
75

Finished this lesson?

Mark it complete to update your course progress.

Quick Knowledge Check

Test your Kotlin understanding.

Which keyword creates a read-only variable in Kotlin?

Vinsoft Lab Academy

Learn Kotlin. Build Android applications.

Build a strong Kotlin foundation and continue into practical Android application development.