Here the List supposed to have such a method

 List <String> arrayList = new ArrayList<>(Arrays.asList("", "", "")); 

In this case, Arrays.asList("", "", "") sends the list immediately ...

The question is, does Set have something similar?

1 answer 1

You are welcome:

 final Set<String> set = new HashSet<>(Arrays.asList("","","")); 
  • Damn, I tried it showed me an error)) Thank you, now everything is ok - Aleksey Timoshchenko