Create a Key Value Pair Class
easyQuestion 174Complete the KeyValuePair<K, V> class. The fields are already declared. Add a constructor and complete the two getter methods.
This class uses two independent type parameters — K for the key type and V for the value type.
IMPORTANT: Do NOT write a main method. A hidden test will create KeyValuePair<String, Integer> and KeyValuePair<String, String> objects and verify the getters return the correct values.
Expected output
Joseph 95 Math A
= newline. The output ends with a newline, so print one after the last line.
Hints4 available
Sign in to use hintsTopics
GenericsClasses
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (sysout, psvm, fori)
Your output
Run your code to see the output here...
Test cases
Run your code to see test case results.