本帖最后由 madianguo 于 2012-11-15 23:19 编辑
BufferedReader br = new BufferedReader(new(InputStreamReader("System.in"));
我想把键盘上录入的数据录入到abc.txt中,在读取中我需要把System.in转换成字符流,
我写入的是纯文本还需不需要把字符流转换成字节流了?在写入时我采取下列哪种方法呢?
方法一:BufferedWriter bw = new BufferedWriter(new(OutputStreamWriter("abc.txt")));
方法二:BufferedWriter bw = new BufferedWriter(new FileWriter("abc.txt")); |