Javatpoint Logo

If we added a,5,null in HashSet, then why null will be display at beginning [o/p:[null, a, 5]]

By: rahul.*** On: Mon Dec 11 01:37:25 IST 2017     Question Reputation0 Answer Reputation0 Quiz Belt Series Points0  0Blank User
import java.util.HashSet;

public class test22_HS {

public static void main(String[] args) {
// TODO Auto-generated method stub
HashSet<Object>hs=new HashSet<>();
hs.add("a");
hs.add(5);
hs.add("a");
hs.add(null);
System.out.println(hs);
}

}
op::[null, a, 5]
Up0Down