Check out example codes for "java vector push_back". It will help you in understanding the concepts better.

Code Example 1

// push_back equivalent
ArrayList<int> a = new ArrayList<int>();
a.add(2);             // Add element to the ArrayList.
a.add(4);

// pop_back equivalent.
a.remove(a.size()-1); // Remove the last element from the ArrayList.

Learn ReactJs, React Native from akashmittal.com