4 Replies Latest reply: Jan 3, 2011 12:34 AM by Parul Garg-Oracle RSS

    Removing from Arraylist

    Parul Garg-Oracle
      I have an ArrayList of selectitems called newRes2 and another Arraylist of String called newentry .
      I want to remove the entry in the newRes2 based on newentry .

      i.e. Suppose newentry has string value "a" and newRes2 also has selectitem with the value "a" . It should remove the entry .

      I tried the same by creating "SelectItem from newentry value " and then the remove method .
      newRes2.remove(new SelectItem(newentry.get(i) ) ));

      But since the objects are different and the output is false.

      Can someone help me with this ? Do i need to over-ride equals method in this case ?