Error message “unreported exception java.io.IOException; must be caught or declared to be thrown” [duplicate]

void showfile() throws java.io.IOException  <-----

Your showfile() method throws IOException, so whenever you use it you have to either catch that exception or again thorw it. Something like:

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

You should learn about exceptions in Java.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)