Skip to content
CodeWiki
Practice
Paths
Tracks
Cheatsheets
Playground
Glossary
AI era
Search
⌘K
English
English
Chinese
Practice
Paths
Tracks
Cheatsheets
Playground
Glossary
AI era
English
English
Chinese
Practice
/
Quiz
/
Kotlin
/
Data classes
What happens to an initialized class-body property when copy() creates a data-class insta…
from Data classes
Kotlin 2.4.10
intermediate
1 min
What happens to an initialized class-body property when copy() creates a data-class instance?
Its current value is copied automatically.
Its initializer runs for the new instance.
The property becomes null.
copy() refuses to compile when body properties exist.
Check
Ask AI about this kata
Report an error
previous kata
Two Packet instances contain distinct byteArrayOf(1, 2) arrays. With data class Packet(va…
Quiz
next kata
Which properties participate in all generated data-class members by default?
Quiz
A new version is available
Reload