import java.util.ArrayList;
public class Example {
public static void main(String[] args) {
// creating the list of integer type
ArrayList <Integer> numList = new ArrayList<>();
// add elements to the arraylist
numList.add(0);
numList.add(1);
numList.add(2);
numList.add(3);
numList.add(4);
}
}
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter