How to create objects with PrintStream in java
Today, the editor will share with you the relevant knowledge points about how to create objects with PrintStream in java. The content is detailed and the logic is clear. I believe most people still know too much about this knowledge, so share this article for your reference. I hope you can get something after reading this article. Let's take a look.
1. Use the output stream out as the output stream of PrintStream. It will not automatically flush and use the default character set.
PrintStream out = new PrintStream (OutputStream out)
2. Create the FileOutputstream corresponding to File, and then use FileOutputstream as the output stream of Printstream.
PrintStream out = new PrintStream (File file)
Create a FileOutputStream for Filename, and then use FileoutputStream as the output stream of PrintStream.
PrintStream out = new PrintStream (String fileName, String charsetName); that's all of the article "how to create objects with PrintStream in java". Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to the industry information channel.