arraylist in java

Java
import java.util.ArrayList;
ArrayList<Integer> myList = new ArrayList<Integer>();
myList.add(0);
myList.remove(0);//Remove at index 0
myList.size();
myList.get(0);//Return element at index 0ArrayList<String> a = new ArrayList<>( Arrays.asList(oldArray));
import java.util.ArrayList;

public class MyClass {
  public static void main(String[] args) {
    ArrayList<String> cars = new ArrayList<String>();
    cars.add("Volvo");
    cars.add("BMW");
    cars.add("Ford");
    cars.add("Mazda");
    System.out.println(cars);
  }
}
import java.util.ArrayList;
Source

Also in Java: