1

What is the difference between

HashSet<Object> hashset = new HashSet<Object>(); 

and

HashSet hashset = new HashSet<>(); 

I have some clarification regarding this, i know that Hashset can hold heterogeneous data type, but i am not sure about the other one

JB Nizet
  • 678,734
  • 91
  • 1,224
  • 1,255
cb rak
  • 57
  • 6

0 Answers0