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
Two Packet instances contain distinct byteArrayOf(1, 2) arrays. With data class Packet(va…
from Data classes
Kotlin 2.4.10
intermediate
1 min
Two Packet instances contain distinct byteArrayOf(1, 2) arrays. With data class Packet(val bytes: ByteArray), what does packetA == packetB return?
true, because a data class recursively compares array elements
false, because the ByteArray references are distinct
A compilation error, because arrays are forbidden in data classes
It depends on the generated toString() output
Check
Ask AI about this kata
Report an error
next kata
What happens to an initialized class-body property when copy() creates a data-class insta…
Quiz
A new version is available
Reload