Why HashSet is sorted?
<p>I am learning about containers in Java and I've read recently that HashSet doesn't give the elements in order. What's interesting for <strong>Integer</strong> my randomly made HashSet is sorted. When I changed its type to <strong>Double</strong> the printed HashSet was sorted no more. My question is: does HashSet work differently for various types then?</p>