What throws an IOException in Java?

前端 未结 3 1007
自闭症患者
自闭症患者 2020-11-28 05:13

java.io.IOException seems to be the most common type of exception, and coincidentally, it seems to also be the most ambiguous.

I keep seeing the th

3条回答
  •  鱼传尺愫
    2020-11-28 05:58

    In general, I/O means Input or Output. Those methods throw the IOException whenever an input or output operation is failed or interpreted. Note that this won't be thrown for reading or writing to memory as Java will be handling it automatically.

    Here are some cases which result in IOException.

    • Reading from a closed inputstream
    • Try to access a file on the Internet without a network connection

提交回复
热议问题