I would like to convert the string containing abc to a list of characters and a hashset of characters. How can I do that in Java ?
abc
List
In Java8 you can use streams I suppose. List of Character objects:
List chars = str.chars() .mapToObj(e->(char)e).collect(Collectors.toList());
And set could be obtained in a similar way:
Set charsSet = str.chars() .mapToObj(e->(char)e).collect(Collectors.toSet());