我无法看到下面的代码有什么问题。它在没有空值时输出空值。
输出:null This is one. This is two. This is three. This is four five six. seven? null
文件内容:
This is one.
This is two.
This is three.
This is four
five
six.
seven?
对此的任何帮助将不胜感激!
try (BufferedReader br = new BufferedReader(new FileReader(filename))) {
String cLine="";
while ((cLine = br.readLine()) != null) {
content+= cLine;
}
} catch (IOException e) {
e.printStackTrace();
}
System.out.println(content);