PackageTest.stream;ImportJava.io.BufferedReader;ImportJava.io.BufferedWriter;ImportJava.io.FileWriter;Importjava.io.IOException;ImportJava.io.InputStreamReader;ImportJava.io.PrintWriter;/*** Write an HTML program from the console and output *@authorFrost.yen * @e-mail [email protected] * @date April 13, 2016*/ Public classtesthtml { Public Static voidMain (string[] args) {bufferedreader br=NULL; PrintWriter out=NULL; Try{br=NewBufferedReader (NewInputStreamReader (system.in)); out=NewPrintWriter (NewBufferedWriter (NewFileWriter ("E:\\java\\examples\\to learn\\src\\test\\stream\\test.html"))); String Str=NULL; while(str = br.readline ())! =NULL){ if(Str.equals ("Exit") {System.out.println ("Thank You"); Break; } out.println (str); } } Catch(IOException e) {e.printstacktrace (); }finally { Try { if(br!=NULL) Br.close (); } Catch(IOException e) {e.printstacktrace (); } Try { if(out!=NULL) Out.close (); } Catch(Exception e) {e.printstacktrace (); } } }}
After running in console input
<body>
<marquee></body>
Exit
Enter
You can generate test.html
[Java] writes an HTML program through the console and saves