×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Added: May 5, 2021 10:28 AM
Views: 3973
Tags: collections
  1.     public static void main(String[] args) {
  2.  
  3.         ArrayList<String> colors = new ArrayList<>();
  4.  
  5.         colors.add("blue");
  6.         colors.add("grey");
  7.         colors.add("red");
  8.         colors.add("green");
  9.  
  10.         for(var c : colors){
  11.             System.out.println(c);
  12.         }
  13.     }
  14. }