public class Demo6 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("请输入信息:");
String line = sc.nextLine();
sc.close();
char[] arr = line.toCharArray();
Set<Character> set = new HashSet<>();
set = new LinkedList<>();
for ( char ch : arr) {
set = add(ch);
}
for (Character character : set) {
System.out.println(character + " ");
}
}
}
22,24两行怎么错了?为什么出错。