title: Cast exception issue in map with values of type Object
body: <p>Follow the code block.</p>
  
  <pre><code>Map&lt;String, Object&gt; personDetailMap = new HashMap&lt;String, Object&gt;();
  personDetailMap.put("name", "isuru");
  personDetailMap.put("is-male", true);
  (String)personDetailMap.get("is-male");
  </code></pre>
  
  <p>Final statement causes an exception: ClassCastException cannot cast Boolean to String
  also note that value I'm trying to read is put as of primitive type boolean</p>
  
  <p>My question is personDetailMap will return a object of Class Object then why its giving a cast exception of Boolean to String.</p>