consider a list with values 1 2 2 2 5 i need to retrieve data to check whether the data has duplicate or not by using hashcode. can anyone suggest me through example. just need to diaplay amessage saying that ---yes the data inside has duplicate values
I'm not exactly sure I got your question, however, keep in mind that Lists may contain duplicate values. On the other hand, Sets cannot contain duplicate values. Perhaps you can work with Sets if you don't want duplicate values (or copy the values to a Set and check its size compared to the List).