1import java.util.ArrayList;
2
3public class SetExample {
4 public static void main(String args[]) {
5 ArrayList<Integer> arraylist = new ArrayList<Integer>();
6 arraylist.add(1);
7 System.out.println(arrayList.get(0));
8 //1
9 arrayList.set(0, 2)
10 System.out.println(arrayList.get(0));
11 //2
12 }
13}