title: How to define 2 constructors with 2 different type of HashMaps?
body: <p>I have a class with 2 HashMap fields as follows-</p>
  
  <pre><code>HashMap&lt;String, Integer&gt; map1;
  HashMap&lt;String, String&gt; map2;
  </code></pre>
  
  <p>Now, I want to only pass one of the maps in the constructor, that is either of type of map1 or of map2. However, I am not able to define 2 different constructors with HashMaps of different types. Is that a workaround for this? </p>