Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • if you use IntStream.of(ints).forEach(System.out::print); i don't think it will print in new line.. Commented Apr 28, 2022 at 7:08
  • also System.out.println(Arrays.stream(new int[3]).mapToObj(Integer::toString).collect(Collectors.joining(", ", "{", "]"))); prints ` {0, 0, 0]` Commented Dec 28, 2024 at 16:19
  • To run the above code you have to make the necessary imports : import java.util.stream.IntStream; import java.util.stream.Collectors; import java.util.stream.Stream; import java.util.Arrays; import java.time.DayOfWeek; and use DayOfWeek [] days = { DayOfWeek.FRIDAY, DayOfWeek.MONDAY, DayOfWeek.TUESDAY }; Commented Jul 21 at 3:05