Skip to content

Instantly share code, notes, and snippets.

@anhnguyen1618
Created July 6, 2020 08:02
Show Gist options
  • Save anhnguyen1618/fd30f1286c58f08819989e6c008725f1 to your computer and use it in GitHub Desktop.
Save anhnguyen1618/fd30f1286c58f08819989e6c008725f1 to your computer and use it in GitHub Desktop.
int[] vectorCPP = {1, 2, 3, 4, ...};
ArrayList<Integer> arrayListJava = new ArrayList<Integer>(length_of_vectorCPP);
for (int i: vectorCPP) {
Integer intObject = new Integer(i);
arrayListJava.Add(intObject);
}
return (List<Integer>) arrayListJava;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment