February 2018
Intermediate to advanced
350 pages
7h 35m
English
So, how can we overcome this? How can we enforce immutability? The const val properties are here to help us. Just modify val myString with const val myString and you cannot implement the custom getter.
While val properties are read-only variables, const val on the other hand are compile time constants. You cannot assign the outcome (result) of a function to const val. Let's discuss some of the differences between val and const val:
Read now
Unlock full access