I just understand that a solution can be useful to other people. will first be filled with duplicate values ββfrom BufferReader.
ArrayList<String> first = new ArrayList<String>();
To extract unique values, I just create a new ArrayList, like down:
ArrayList<String> otherList = new ArrayList<>(); for(String s : first) { if(!otherList.contains(s)) otherList.add(s); }
A lot of Internet posts all say to assign my Arraylist to a List, Set, HashTable or TreeSet. Can someone explain the difference in theory, while someone is better to use in practice? thnks for your time guys.
Junior Fulcrum
source share