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

Code Example 1

// Java code illustrating add() method 
import java.util.*; 
class Vector_demo { 
    public static void main(String[] arg) 
    { 
  
        // create default vector 
        Vector v = new Vector(); 
  
        v.add(1); 
        v.add(2); 
        v.add("geeks"); 
        v.add("forGeeks"); 
        v.add(3); 
  
        System.out.println("Vector is " + v); 
    } 
}

Learn ReactJs, React Native from akashmittal.com