title: convert Object[] from a hashmap keyset to String[]?
body: <pre><code>Set&lt;String&gt; keys = mappings.keySet();
  String[] keyArray = (String[]) keys.toArray();
  
  String hashmapDetails = "";
  for(int p=0; p &lt; keyArray.length; p++){
      String[] details = keyArray[p].split("/");
      hashmapDetails += details[1];
      hashmapDetails += mappings.get(keyArray[p]);
      if (p != keyArray.length -1){
          hashmapDetails += ";";
      }
  }
  </code></pre>
  
  <p>Pardon my lack of understanding but I'm trying to explore the usage of hashmaps. I understand that the toArray() returns an Object[]. However, is it not possible to type cast it to a String[]? As you can see in the codes, later, I need to go through an array and do some splitting and other String manipulation.</p>
  
  <p>By doing this I got an error:</p>
  
  <pre><code>java.lang.ClassCastException: java.lang.Object[] cannot be cast to java.lang.String[]
  </code></pre>
  
  <p>Any guidance on how I should tackle this is greatly appreciated. Thanks!</p>