I have array of Strings which actually in nothing but list of integers coming from file. I converted it to HashSet so as to remove duplicates as follows:
Set<String> intSet = new HashSet<String>(Arrays.asList(strArr));
I expected that it all the numbers to be in order but off course, since this is a string and not integer list, it may not come in order. But whenever I try to print this HashSet, I always get output as follows:
[3, 2, 1, 4]
[3, 2, 5, 4]
Every time, if 3 is present it is considered to be first element. I am not getting why it is acting this way? Can anyone please explain me this.