system.out.println
doesn't conforms to system.out.print
when printing a java.util.stream
.
1)
Stream.of(1, "1B").forEach(System.out::print);
result:
11B
2)
Stream.of(1, "1C").forEach(System.out::println);
result
1
1C
3)
Stream.of(1, "1B").forEach(System.out::println);
result
1
Can anybody explain why 1B
is excluded from the result in case 3
? I suppose "1B"
conflicts with binary literals. If yes, why is the case 1
printing "1B"
with the print method? I also wonder why "1B"
is not considered being a string literal in the stream in case 3
?