Advertisement
Guest User

Mary

a guest
Oct 20th, 2014
316
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. import java.io.File;
  2. import java.io.FileNotFoundException;
  3. import java.io.PrintStream;
  4. import java.util.Scanner;
  5.  
  6. public class Mary
  7. {
  8. public static void main(String[] args) throws FileNotFoundException
  9. {
  10.  
  11. Scanner poem = new Scanner(new File("poem.txt")); // give a directory
  12. PrintStream output = System.out;
  13. PrintStream outputFile = new PrintStream(new File("mary.html"));
  14. StringBuffer mary = new StringBuffer("<html><body><p>");
  15.  
  16. while (poem.hasNextLine())
  17. {
  18. mary.append(poem.nextLine());
  19. mary.append("<br>");
  20. }
  21. output.println("</p></body></html>");
  22. outputFile.println(poem.toString());
  23.  
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement