In Kotlin, both var and val are used to declare variables, but the primary distinction lies in the mutability of the variables:
var: Declares a mutable variable, meaning its value can be modified after initialization.val: Declares an immutable variable, also known as a read-only variable. Once initialized with an initial value, its value cannot be altered. In short, a variable defined withvalis equivalent to afinalvariable in Java.