Is
new PrintWriter(ExampleStream).print("Just Something");
same as
PrintWriter pw = new PrintWriter(ExampleStream);
pw.print("Just Something");
pw.close();
So will the PrintWriter close?
No.
And technically the term anonymous in Java refers to creating a local class without a name. What you did is just creating an instance of a class without assigning it to a variable.