mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-18 00:20:54 +07:00
21 lines
479 B
Java
21 lines
479 B
Java
import java.io.IOException;
|
|
|
|
class Main48 {
|
|
public static void main(String[] args) throws Exception {
|
|
templateMethod(( ) -> {
|
|
throw new IOException();
|
|
});
|
|
}
|
|
|
|
static void templateMethod(RunnableWithException<IOException> r) {
|
|
try {
|
|
r.run();
|
|
} catch (IOException e) {
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
|
|
interface RunnableWithException<E extends Exception> {
|
|
void run() throws E;
|
|
}
|
|
} |