×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Added: May 5, 2021 10:26 AM
Views: 3972
Tags: collections
  1.  
  2. // TODO: 05.05.2021 New Array List, add some colors(string) and print out the collection
  3.  
  4. import java.util.ArrayList;
  5. public class Main {
  6.  
  7.     public static void main(String[] args) {
  8.  
  9.         ArrayList<String> colors = new ArrayList<>();
  10.  
  11.         colors.add("blue");
  12.         colors.add("grey");
  13.         colors.add("red");
  14.         colors.add("green");
  15.  
  16.         System.out.println(colors);
  17.     }
  18. }
  19.