我来客串一下...
import java.io.*;
public class Demo{
public static void main(String[] args){
try{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String strLine = br.readLine(); //读取一行数据到strLine里
PrintStream ps = new PrintStream(new File("D:\\Java\\demo.txt"));
ps.println(strLine);
ps.close();
}catch(IOException e){}
}
}