title: Java: How to save console output to a text file?
body: <p>For example, in the code, I have: <code>System.out.println("Hello World");</code></p>
  
  <p>The console will print: <code>Hello World</code></p>
  
  <p>So, I want to save the console output into a text file. Can anyone please hint me through this?</p>