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

Vector.lastIndexOf(elem,index) fails ...

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      1.1fcs
    • CPU:
      sparc
    • OS:
      solaris_2.5
    • Verification:
      Not verified

      Description

      Method Vector.lastIndexOf(elem,index) fails for elementData[k] == elem where
      k== index.

      Please check the following Program should return 5 insted returns 2.

      ---------8<----------------------------------------------



      import java.util.Vector;

      public class VectorTest {

        public static void main(String[] argv) {

          Vector v = new Vector();
          v.addElement("0");
          v.addElement("1");
          v.addElement("2");
          v.addElement("3");
          v.addElement("4");
          v.addElement("2");
          v.addElement("6");

          System.out.println("v.lastIndexOf(\"2\",5) returns:" + v.lastIndexOf("2",5));
        }
      }

        Attachments

          Activity

            People

            Assignee:
            nsaraiyasunw Nakul Saraiya (Inactive)
            Reporter:
            duke J. Duke (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: