-5

I am new to Java and I want to know when an IOException occurs and what is it actually. I also came across a point that whenever we use BufferedReader class to read input from console the code should be kept within try block and we should have a catch block that handles the IOException why is that so. Can someone help me ?

Paul Vargas
  • 41,222
  • 15
  • 102
  • 148
darsha
  • 61
  • 1
  • 9

1 Answers1

2

The IOException is part of the interface. Errors usally occur when a file is not present, the disk is full, you are missing reading or writing privledges or you have network connectivity issues.

Depending on the implementation it might as well throw no errors at all even though its still declared in the interface.

Udo Held
  • 12,314
  • 11
  • 67
  • 93