I want to implement the Map<K,V> interface, but I want to constrain K to type String.
Is this possible? Or does the interface definition impose that K be polymorphic?
If it is possible, could someone help with the class signature, tks.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
try :
class Test< V > implements Map< String, V >hope it helps