Check out example codes for "declaration of list in java". It will help you in understanding the concepts better.

Code Example 1

ArrayList<String> list=new ArrayList<String>();//Creating arraylist    
      list.add("Mango");//Adding object in arraylist    
      list.add("Apple");    
      list.add("Banana");    
      list.add("Grapes");    
      //Printing the arraylist object   
      System.out.println(list);

Code Example 2

String[] newStringArrray = new String[] {"Item1", "Item2", "Item3"};

Learn ReactJs, React Native from akashmittal.com