unexpected String.join() behavior

unexpected String.join() behavior

I tried to print contents of a&nbsp;<code>List&lt;String&gt;</code>&nbsp;with a "<strong>,</strong>" in between them. Followed the book Functional Programming in Java by Venkat Subramaniam, on page&nbsp;<strong>54</strong>&nbsp;, he did exactly what I am doing but my print result is coming as a single string without a comma<code>(,)</code>.

I tried to print contents of a List<String> with a "," in between them. Followed the book Functional Programming in Java by Venkat Subramaniam, on page 54 , he did exactly what I am doing but my print result is coming as a single string without a comma(,).

String[][] deepArrayStr = new String[][]{{"Alex", "nullpointer"}, {"Eran", "George"}};
 List<String> str= Arrays.stream(deepArrayStr)
     .flatMap(Arrays::stream)
     .collect(Collectors.toList());
for(String s:str){
    System.out.print(String.join(",",s));
}

OutputAlexnullpointerEranGeorge

ExpectedAlex,nullpointer,Eran,George

I tried another way and it works fine, I just wanted to know is there anything that I am doing wrong in the above approach whereas in the book Venkat also did the same thing that I am doing?

 System.out.println(Arrays.stream(deepArrayStr)
        .flatMap(Arrays::stream)
        .collect(Collectors.joining(",")));

OutputAlex,nullpointer,Eran,George

ExpectedAlex,nullpointer,Eran,George

My question is not to convert from List to string but to add delimiter while printing.

Angular 9 Tutorial: Learn to Build a CRUD Angular App Quickly

What's new in Bootstrap 5 and when Bootstrap 5 release date?

Brave, Chrome, Firefox, Opera or Edge: Which is Better and Faster?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

Java Fundamentals: Learn Java for absolute beginners |Simpliv

Java Fundamentals: Learn Java for absolute beginners

Java Essentials : Learn Core Java From Basic to Advance

Learn Java Programming Using Practical Assignments. Start Building Back-end Web Applications Robust Test Automation Frameworks By End Of The Course. Learn More!

Fundamentos de Java: Aprende Java desde cero, sin misterios | Simpliv

Fundamentos de Java: Aprende Java desde cero, sin misterios