fork download
  1. import java.util.*;
  2.  
  3. class Ideone
  4. {
  5. public static void main (String[] args) throws java.lang.Exception
  6. {
  7. int height = 10;
  8. List<Integer>[] colors = new ArrayList[height];
  9.  
  10. for (int n = 0; n < colors.length; ++n) {
  11. colors[n] = new ArrayList<Integer>();
  12. }
  13. colors[0].add(40);
  14. System.out.println("colors[0].get(0) = " + colors[0].get(0));
  15. }
  16. }
Success #stdin #stdout 0.12s 320576KB
stdin
Standard input is empty
stdout
colors[0].get(0) = 40