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

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

XMLWordPrintable

    • 1.1fcs
    • sparc
    • solaris_2.5
    • Not verified

      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));
        }
      }

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: