The simplest approach to resolve a collision is linear probing.
In this technique, if a value is already stored at a location generated by h(k), it means collision occurred then we do a sequential search to find the empty location.
Here the idea is to place a value in the next available position
https://www.geeksforgeeks.org/java-program-to-implement-hashtables-with-linear-probing/