fork(1) download
  1. import java.util.List;
  2. import java.util.ArrayList;
  3.  
  4. public class Main {
  5. public static void main(String[] args) {
  6. List<List<Character>> maze = new ArrayList<List<Character>>();
  7. List<Character> aRow = new ArrayList<Character>();
  8. aRow.add('a');
  9. aRow.add('b');
  10. aRow.add('c');
  11.  
  12. maze.add(aRow);
  13.  
  14. List<Character> anotherRow = new ArrayList<Character>();
  15. anotherRow.add('d');
  16. anotherRow.add('e');
  17. anotherRow.add('f');
  18. maze.add(anotherRow);
  19.  
  20. for (List<Character> row: maze) {
  21. for (Character c : row)
  22. System.out.print(c+" ");
  23. System.out.println();
  24. }
  25. }
  26. }
  27.  
  28.  
Success #stdin #stdout 0.07s 380224KB
stdin
Standard input is empty
stdout
a b c 
d e f