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
/
Delegated properties
What does val age: Int by values guarantee when values has type Map<String, Any?>?
from Delegated properties
Kotlin 2.4.10
intermediate
1 min
What does val age: Int by values guarantee when values has type Map<String, Any?>?
Only that reads use the key "age"; key presence and runtime value type can still fail
The compiler inserts age with a default value of zero when it is missing
Every Number value is automatically converted to Int
Renaming the property also migrates persisted map keys
Check
Ask AI about this kata
Report an error
next kata
What does this program print?
Predict the output
A new version is available
Reload