-
-
Save rohitsat13/03fb3811251db0818d96436b059a1f86 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Copyright 2021 Google LLC. | |
SPDX-License-Identifier: Apache-2.0 */ | |
data class MyData( | |
- var num: Int | |
+ val num: Int | |
) | |
- myObj.num = 5 // Fails to compile when num is val | |
+ val newObj = myObj.copy(num = 5) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment