Question: what is the difference between hashset and arraylist?
Answer: HashSet is an unordered collection and doesn't maintain any order. ArrayList allows duplicate values in its collection. On other hand duplicate elements are not allowed in Hashset. ... On other hand Hashset allows only one null value in its collection,after which no null value is allowed to be added.