If you can use Java 9 and newer, you can use this syntax: List<String> strings = new ArrayList<>(List.of("Hello", "world")); ...
確定! 回上一頁