Advertisement
Guest User

Untitled

a guest
Feb 20th, 2020
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. StringBuilder ans = new StringBuilder();
  2. String output = ans.toString();
  3. File outfile = new File("example.txt");
  4. FileWriter fr = null;
  5. try {
  6. fr = new FileWriter(file);
  7. fr.write(output);
  8. } catch (IOException e) {
  9. e.printStackTrace();
  10. }
  11. try {
  12. fr.close();
  13. } catch (IOException e) {
  14. // TODO Auto-generated catch block
  15. e.printStackTrace();
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement