This discussion is archived
3 Replies Latest reply: Oct 2, 2013 3:22 PM by DrClap RSS

java.util.HashSet implementation

fabe0c8e-62ef-4cee-9d57-8a797b661888 Newbie
Currently Being Moderated


I was looking at java.uti.HashSet implementation where below mentioned value is used as value of Hashmap key - value pair in implementation of Hashset. Can we use null instead of new Object().

 

private static final Object PRESENT=new Object();

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points