Check out example codes for "initialiser une arraylist". It will help you in understanding the concepts better.

Code Example 1

ArrayList couleurs = new ArrayList() {{
 add(Rouge);
 add(Bleu);
 add(Vert);
}};

Learn ReactJs, React Native from akashmittal.com