ioexception

Why do I get the “Unhandled exception type IOException”?

末鹿安然 提交于 2019-11-26 01:36:43
问题 I have the following simple code: import java.io.*; class IO { public static void main(String[] args) { BufferedReader stdIn = new BufferedReader(new InputStreamReader(System.in)); String userInput; while ((userInput = stdIn.readLine()) != null) { System.out.println(userInput); } } } And I get the following error message: ---------- 1. ERROR in io.java (at line 10) while ((userInput = stdIn.readLine()) != null) { ^^^^^^^^^^^^^^^^ Unhandled exception type IOException ---------- 1 problem (1

IOException: The process cannot access the file 'file path' because it is being used by another process

瘦欲@ 提交于 2019-11-25 21:57:47
问题 I have some code and when it executes, it throws a IOException , saying that The process cannot access the file \'filename\' because it is being used by another process What does this mean, and what can I do about it? 回答1: What is the cause? The error message is pretty clear: you're trying to access a file, and it's not accessible because another process (or even the same process) is doing something with it (and it didn't allow any sharing). Debugging It may be pretty easy to solve (or pretty