Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- List<List<Cell>> matrix = new ArrayList<>();
- List<Cell> row1 = new ArrayList<>(1);
- row1.add(new Cell(false));
- row1.add(new Cell(false));
- row1.add(new Cell(false));
- matrix.add(row1);
- List<Cell> row2 = new ArrayList<>(2);
- row2.add(new Cell(false));
- row2.add(new Cell(false));
- row2.add(new Cell(false));
- matrix.add(row2);
- List<Cell> row3 = new ArrayList<>(2);
- row3.add(new Cell(false));
- row3.add(new Cell(false));
- row3.add(new Cell(false));
- matrix.add(row3);
- System.out.println();
- matrix.add(Arrays.asList(new Cell(false),new Cell(false),new Cell(false)));
- System.out.println("Size = "+ matrix.size());
- for (int i=0; i<matrix.size();i++){
- System.out.println(matrix.get(i));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement