I was going though the source code of method V get(Object key);
of java.util.Map
it accepts Object
as parameter for key, here my question is why it doesn't accept generic type K
instead of object? So that get
method will be more type safe?
Asked
Active
Viewed 30 times
0

eatSleepCode
- 4,427
- 7
- 44
- 93
1 Answers
0
It has been there before there were generics ... and even before they stated the java version, in which it was added to java, in the docs.

gross.jonas
- 81
- 7