Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8295384

remove() method of ArrayList is not removing specified object

XMLWordPrintable

      A DESCRIPTION OF THE PROBLEM :
      I have added a, b and c objects in ArrayList and when I am try to delete object c but its deleting object a.

      ArrayList list = new ArrayList();
      Integer a = new Integer(3);
      list.add(a);
      Integer b = new Integer(2);
      list.add(b);
      Integer c = new Integer(3);
      list.add(c);
      list.remove(c);

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      should delete object c
      ACTUAL -
      its deleting object a

      FREQUENCY : always


            tongwan Andrew Wang
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: