0

How would I print a simple paragraph on a piece of paper the same way System.out.println("words") would work? Using a printwriter to put it in a .txt file and printing from there would also be a viable option.

1 Answers1

0

Possible duplicate? How do I create a file and write to it in Java?

PrintWriter writer = new PrintWriter("the-file-name.txt", "UTF-8");
writer.println("The first line");
writer.println("The second line");
writer.close();
invincibles04
  • 109
  • 3
  • 13