• Saves Valuable Time
  • Trusted Accuracy for 14 Years
  • 15-Day Money-Back Guarantee

Java Equivalent to C++ std::vector

The nearly exact Java equivalent to the C++ std::vector collection is the Java ArrayList collection.

C++ Java
#include <vector>

virtual void Vector()
    std::vector<int> myList;
    int i = 1;
    myList[0] = i;
    i = myList[0];
void Vector()
    java.util.ArrayList<Integer> myList = new java.util.ArrayList<Integer>();
    int i = 1;
    myList.set(0, i);
    i = myList.get(0);

Use C++ to Java Converter to convert from C++ to Java.     

Additional resource: Java and C++ Equivalents

Copyright © 1997 – 2018 Tangible Software Solutions Inc.