I am trying to declare an array of Set<String> so I do not have to manage each sets separately. But things go wrong:
ArrayList<Set<String>> categories=new LinkedHashSet<>();
Here, Java says that type Set<String> is erroneous and then reports an error.
If this is wrong, then how can I make an array of :
static Set<String> category1 = new LinkedHashSet<>();
LinkedHashSetis not anArrayListof anything.Sets individually. If that's a pain, make your own ListSet class and encapsulate the management.