To become more familiar with Java generics.
For this lab, you will be changing this hash table class to use generics instead of Object references.
As it currently stands, there is nothing to stop someone from using different types of keys and values in the table.
You will change the class and the main program to use generics instead.
- Download the HashExercise.java file.
- Change the class HashTable to be generic. It should take two type parameters: the type of the key and the type of the value.
- When multiple type parameters are used, they are separated by commas.
- Change each reference to "Object" in the class to one of the two type parameters.
- Change the main function to supply the type String for the key and Integer for the value.
When your program works, email the code to firstname.lastname@example.org.
Copyright © 2018 Ian Finlayson | Licensed under a Creative Commons Attribution 4.0 International License.