java arraylist

Java
ArrayList<String> a = new ArrayList<>( Arrays.asList(oldArray));
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 0import 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;import java.util.ArrayList; // import the ArrayList class

ArrayList<String> cars = new ArrayList<String>(); // Create an ArrayList objectList<String> words = new ArrayList<String>();
Source

Also in Java: