Are you as good as a Java compiler? Look at this code and say what it does. Check fifty seventh question of full-stack dev quiz to check if you know the joining collector.
Look at the Java 11 code below and say what it prints to the standard output.
System.out.println(List.of("a", "b", "c").stream().collect(Collectors.joining(",")));
Choose the best answer.
- abc,
- ,abc,
- a,b,c
- a,b,c,
- ,a,b,c,
For the correct answer scroll down
.
.
.
.
.
.
The correct answer is: c. If you would like to read more, check Join string array in Java - performance article.