| Author |
problem in arraylist
|
vijayz devraj
Greenhorn
Joined: Apr 03, 2008
Posts: 7
|
|
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
|
 |
Manuel Leiria
Ranch Hand
Joined: Jul 13, 2007
Posts: 171
|
|
|
Check the contains() method in ArrayList
|
Manuel Leiria<br /> <br />--------------<br />Peace cannot be kept by force; it can only be achieved by understanding. <br /> Albert Einstein
|
 |
Rodrigo Tomita
Ranch Hand
Joined: Apr 28, 2008
Posts: 70
|
|
Vijayz, 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). Regards. Rodrigo
|
 |
Ankur Sharma
Ranch Hand
Joined: Dec 27, 2005
Posts: 1234
|
|
I am not sure, but are you looking something like this: This has int[] but you can have any other object and compare it accordingly..
|
The Best way to predict your future is to create it
Ankur Sharma
|
 |
 |
|
|
subject: problem in arraylist
|
|
|