add in list java

Java
// Java code to show the implementation of 
// add method in list interface 
import java.util.*; 
public class GfG { 
  
    // Driver code 
    public static void main(String[] args) 
    { 
        List<Integer> l = new ArrayList<>(); 
        l.add(10); 
        l.add(15); 
        l.add(20); 
        System.out.println(l); 
    } 
} 

Source

Also in Java: