stream-exception


  • 不可变集合(Immutable Collection)

  -- of() 方法

List lists = List.of(569.5, 700.5, 523.0, 570.5);
        // lists.add(689.0); // Immutable object is modified
        System.out.println(lists); // [569.5, 700.5, 523.0, 570.5]
        // lists.set(1, 500.0); // Immutable object is modified
        // 不允许重复!
        Set names = Set.of("迪丽热巴", "迪丽热九", "卡尔砸吧", "马儿扎哈");
        System.out.println(names); // [马儿扎哈, 卡尔砸吧, 迪丽热九, 迪丽热巴]
        // 不可变的 Map 集合
        Map maps = Map.of("HuaWei" ,2, "Java", 1, "手表", 1);
        System.out.println(maps); // {HuaWei=2, Java=1, 手表=1}
  • Stream

  •  Exception

  ---- 分类 ----

  编译时异常 / 运行时异常

  -- 1 try {...} catch (...) {...}

  -- 2 throws / throw