小编Han*_*ein的帖子

Set 类型的 of() 方法未定义

当我尝试运行此代码时:

Set<Set<Integer>> s1 = Set.of(Set.of(), Set.of(1));
Run Code Online (Sandbox Code Playgroud)

我收到此错误:

The method of() is undefined for the type Set
The method of(int) is undefined for the type Set
Run Code Online (Sandbox Code Playgroud)

我正在使用 Java 8。出了什么问题?:/

java compiler-errors set

3
推荐指数
1
解决办法
5899
查看次数

标签 统计

compiler-errors ×1

java ×1

set ×1