Stack Exchange
Stack Overflow
Questions
Tags
Users
About
Stack Overflow
Public
Questions
Tags
Users
About
Why is the declared type different from the instantiated type?
Asked
Mar 28 '18 at 12:32
Active
Mar 28 '18 at 12:32
Viewed
17 times
0
final Map map = new ConcurrentHashMap<>();
Why declare a Map and instantiate a ConcurrentHashMap?
java
dictionary
concurrenthashmap
asked Mar 28 '18 at 12:32
nicomp
4,344
4
27
60
1
you may want to google "code against interfaces". The explanation is way too broad to explain here
–
Stultuske
Mar 28 '18 at 12:32
1
Duplicate of https://stackoverflow.com/q/383947/6253321
–
cpp beginner
Mar 28 '18 at 12:34
0 Answers
0