Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.File;
- import java.io.FileNotFoundException;
- import java.io.PrintStream;
- import java.util.Scanner;
- public class Mary
- {
- public static void main(String[] args) throws FileNotFoundException
- {
- Scanner poem = new Scanner(new File("poem.txt")); // give a directory
- PrintStream output = System.out;
- PrintStream outputFile = new PrintStream(new File("mary.html"));
- StringBuffer mary = new StringBuffer("<html><body><p>");
- while (poem.hasNextLine())
- {
- mary.append(poem.nextLine());
- mary.append("<br>");
- }
- output.println("</p></body></html>");
- outputFile.println(poem.toString());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement