转换流写法标准格式:
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
public class TranseDemo1 {
public static void main(String[] args)throws IOException {
BufferedReader bfr = new BufferedReader(new InputStreamReader(System.in));
BufferedWriter bfw = new BufferedWriter(new OutputStreamWriter(System.out));
String line = null;
while((line = bfr.readLine())!=null){
if("over".equalsIgnoreCase(line)){
break;
}
bfw.write(line.toUpperCase());
bfw.newLine();
bfw.flush();
}
bfw.close();
bfr.close();
}
}
|
|