如何將字符列表添加到集合中?下面的代碼似乎不起作用。HashSet<Character> vowels = new HashSet<Character>(
new Character[] {'a', 'e', 'i', 'o', 'u', 'y'}
);我看到的錯誤是構造函數 HashSet(Character[]) 未定義我嘗試了Character[]和char[],但都不起作用。
如何將字符數組轉換為集合
慕碼人8056858
2023-09-20 16:26:05