Throw an IOException

Report a typo

Modify the given method. It should throw an IOException.

Write a program in Java 17
import java.io.IOException;

public class Main {

// change this method
public static void method() {

}

/* Do not change code below */
public static void main(String[] args) {
try {
method();
} catch (Exception e) {
System.out.println(e.getClass());
}
}
}
___

Create a free account to access the full topic