collections - getting object from arraylist using equals method - java -
i have 2 list of objects. want compare both lists. have custom objects in these 2 lists. thought can override equals method , object array list - list.get(objectref) , should give required object based on equals method comparison. came know there no such support yet.
instead of looping through entrie list , finding it, there anyway give required object list single call. available in apache utils lib or external lib?
thanks in advance
you can use:
list.get(list.indexof(objectref));
Comments
Post a Comment