public class SY63 {
public static void main(String[] args) throws Exception {
System.out.print("请输入字符串:");
Scanner in = new Scanner(System.in);
String st = in.nextLine(); FileWriter fw = new FileWriter("d:\\test.txt");
fw.write(st);
fw.close(); FileReader fr = new FileReader("d:\\test.txt");
char[] bchar= new char[1024];
int len = 0;
while((len = fr.read(bchar)) != -1){
System.out.print(new String(bchar,0,len));
}
fr.close();
}
}