public class Test07 {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
BufferedWriter bw = new BufferedWriter(new FileWriter("aa.txt"));
String line = null;
while((line=br.readLine())!=null){ //为什么不换行呢?
if("over".equals(line)){
break;
}
bw.write(line);
bw.flush();
}
bw.close();
br.close();
}
}
|