当我在小文件上运行bufferReader它工作正常但是当我在一个大文件(100,000+)上运行它时它没有显示所有内容。当我通过调试器运行它显示显示的行但由于某种原因消失了你不知道为什么? (试过几个不同的例子,但仍然得到游戏结果)
BufferedReader reader = new BufferedReader(new FileReader("NumFile.txt"));
String line;
while((line = reader.readLine()) != null) {
System.out.println(line);
}
reader.close();
答案 0 :(得分:-2)
在这方面使用java8
码
-- 1. "the parts are not supplied by all the suppliers"
P(P.pid, P.pname)
AND EXISTS S.sid, S.sname [S(S.sid, S.sname) AND NOT C(S.sid, P.pid)]
-- 2 "the parts are not supplied (by some of the suppliers)"
P(P.pid, P.pname) AND NOT EXISTS C.sid C(C.sid, P.pid)
-- 3. "the parts don't have multiple suppliers"
P(P.pid, P.pname)
AND NOT EXISTS C1.sid, C2.sid
[C(C1.sid, P.pid) AND C(C2.sid, P.pid) AND C1.sid <> C2.sid]
打印行代码
try (Stream<String> lines = Files.lines(Paths.get(filename), Charset.defaultCharset())) {
lines.forEachOrdered(line -> process(line));
}
希望我的帮助可以继续编码。