Say in your program you need some values that should never be changed. And this is where 'val' comes into picture.
Let us simplify with the below example.
fun main(){ val x = 5 x = 7 println(x) }
So, in the above code we have created a constant 'x' using the 'val' keyword.
Once the value is assigned to 'x', it cannot be changed as it is a constant.
And that is the reason we ended up with the below error message.