Hello so I have this hashset Code (Java): Set<String> s = new HashSet<String>(); s.addAll(ca.getConfig().getKeys(false)); how do I convert them to ArrayList or List ?
Code (Java): Set<String> s = new HashSet<String>(); s.addAll(ca.getConfig().getKeys(false)); String[] array = s.toArray(new String[s.size()]); List<String> list = Arrays.asList(array); This is how I'd do it.
Code (Java): Set<String> s =new HashSet<String>(); s.addAll(ca.getConfig().getKeys(false)); ArrayList<String> list = new ArrayList<String>(); for(String names : s) { list.add(names); } this is what I did is it edible ?
really ? got it works. you just made the Set strings to an array. nc try thanks for help at the same way.
did I said something contradicts to that ? I think no that I'm aware of I said you just convert the set to string and convert to array then make another convertion of array to list.
That works too but a lot of people don't understand how to use it, hash set extends array list I believe so it works all the same. I just didn't want to give out code that wasn't understandable to the op and others.
well nc idea looking forward to you I hope you answer many more question in the way that they understand what you're solution is.
Oops my bad :O it all boils down to collections huh, I've never looked too much into it I might look more into it when I have the time but when it's 4:09 in the morning I don't really have the thinking power for it <3
he didn't mean to be wrong but the way he wanted to answer people but this clearly contradicts what he said kinda cool and informative thanks for this.