SyntaxFix
Write A Post
Hire A Developer
Questions
You can do it in Java 6:
Set<String> h = new HashSet<String>(Arrays.asList("a", "b", "c"));
But why? I don't find it to be more readable than explicitly adding elements.