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
IntStream can be used to access each character and add them to the list.
String str = "abc"; List charList = new ArrayList<>(); IntStream.range(0,str.length()).forEach(i -> charList.add(str.charAt(i)));