Java初学习-unreported exception java.io.IOException; must be caught or declared to be thrown

来源:互联网 发布:四选一数据选择器芯片 编辑:程序博客网 时间:2024/05/21 06:21

code segment:

public class A{    public void showfile() throws java.io.IOException    {        // do someting    }}

showfile() method throws IOException 

so when ever you use/call it you have to either catch that exception or again thorw it. 

Something like:

try{    showfile();}catch(IOException e){    e.printStackTrace();}

0 0
原创粉丝点击