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
/
Java
/
Wildcards and PECS
Given `List<? extends Number> values`, which operation is guaranteed to type-check?
from Wildcards and PECS
Java 25 LTS
beginner
1 min
Given `List<? extends Number> values`, which operation is guaranteed to type-check?
`Number value = values.get(0);`
`values.add(1);`
`Integer value = values.get(0);`
`List<Number> copy = values;`
Check
Ask AI about this kata
Report an error
previous kata
Spot the bug in the wildcard copy method
Spot the bug
A new version is available
Reload