Timeline for Java ArrayList question
Current License: CC BY-SA 3.0
17 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| May 27, 2011 at 1:36 | vote | accept | Community Bot | ||
| May 16, 2011 at 21:39 | comment | added | aph |
There is ABSOLUTELY no reason here to override equals(). The OP is looking to compare two references to the same object, not two objects.
|
|
| May 16, 2011 at 16:55 | answer | added | Jay | timeline score: 2 | |
| May 16, 2011 at 16:28 | answer | added | musaul | timeline score: 2 | |
| May 16, 2011 at 15:57 | answer | added | Costi Ciudatu | timeline score: 1 | |
| May 16, 2011 at 15:53 | history | edited | user485498 | CC BY-SA 3.0 |
answers to questions
|
| May 16, 2011 at 15:52 | answer | added | ssnyder | timeline score: 0 | |
| May 16, 2011 at 15:49 | comment | added | Oliver Charlesworth |
@ryan: It looks like the OP isn't cloning the objects before adding to B; the default implementation of equals() should therefore return true if the two references match.
|
|
| May 16, 2011 at 15:48 | answer | added | Mikita Belahlazau | timeline score: 1 | |
| May 16, 2011 at 15:48 | answer | added | matt b | timeline score: 0 | |
| May 16, 2011 at 15:48 | answer | added | Amir Raminfar | timeline score: 0 | |
| May 16, 2011 at 15:48 | comment | added | Vaman Kulkarni | What type of elements are there in ArrayList? | |
| May 16, 2011 at 15:48 | comment | added | Oliver Charlesworth |
Can you confirm that there really is still an object in A that should match B.get(i)?
|
|
| May 16, 2011 at 15:48 | answer | added | Gnanz | timeline score: 1 | |
| May 16, 2011 at 15:47 | comment | added | ryanprayogo |
What objects does the ArrayList contain? If it's custom object, it might be because you didn't override the equals() method?
|
|
| May 16, 2011 at 15:47 | comment | added | Jason Terk | What is the type of the objects you are storing in the lists? | |
| May 16, 2011 at 15:44 | history | asked | user485498 | CC BY-SA 3.0 |