Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.LinkedList;
- import java.util.List;
- public class LList {
- public static void main(String[] args) {
- List<List<Integer>> list = new LinkedList<>();
- for (int x = 0; x < 9; ++x) {
- list.add(new LinkedList<>());
- for (int y = 0; y < 9; ++y) {
- list.get(x).add((x + 1) * (y + 1));
- }
- }
- list.stream().forEach(System.out::println);
- for (int i = 0; i < 9; ++i) {
- list.get(i).set(i, 0);
- }
- System.out.println();
- list.stream().forEach(System.out::println);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement