0

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?

eatSleepCode
  • 4,201
  • 6
  • 39
  • 84

1 Answers1

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.