Datasets:

ArXiv:
License:
denisko's picture
cnanged dir structure and removed features file
3e77472
raw
history blame contribute delete
656 Bytes
import java.io.*;
class M {
void method() throws IOException {
throw new IOException("device error");
// try {
// throw new IOException("device error");
// } catch (IOException ex) {
// System.out.println("Caught inside M class" + ex);
// }
}
}
/**
* Case1: You handle the exception
*/
public class ThrowsExample1 {
public static void main(String args[]) {
try {
M m = new M();
m.method();
} catch (Exception e) {
System.out.println("exception handled inisde main method");
}
System.out.println("normal flow...");
}
}