This week's book giveaway is in the NodeJS forum. We're giving away four copies of Serverless Applications with Node.js and have Slobodan Stojanovic & Aleksandar Simovic on-line! See this thread for details.
@Stephan van Hulst, turns out that if in the print statement you use out instead of err the output is the expected. Do not know why if you keep two objects in the try-with-resources and the err in the print statement it works fine.
Stephan van Hulst
posted 3 weeks ago
Ah I see.
The reason is that when you write to two different streams, it is not guaranteed that strings written to one stream first are flushed to the output device before strings written to another stream.
If you want strings to appear in the order that you print them in, you must always print them to the same stream.
Farmers know to never drive a tractor near a honey locust tree. But a tiny ad is okay:
global solutions you can do in your home or backyard