the following:
I have a class, say Students. This class has a method called put which accepts a Map. However, is it possible for me to make it implementation specific, but still generic? For example, I want the put method to only accept HashMap if data from a HashMap was added earlier, or ConcurrentHashMap whichever was used first (ideally during compile time). I'm wondering if I can use Generics to achieve this somehow
https://paste.ofcode.org/tp6ShqFPAuvJSAuVYVZ8Kg If code can help explain my question better
Обсуждают сегодня