• Saves Valuable Time
  • Trusted Accuracy since 2004
  • 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 © 2004 – 2021 Tangible Software Solutions, Inc.