I am trying to solve task 0913, but I get the message that I have to do it in IntelliJ IDEA. However, I do not manage to find this task in the software. Can someone suggest me a way to do it? Thank you.
package fr.codegym.task.task09.task0913;
import java.io.FileNotFoundException;
import java.net.URISyntaxException;
/*
Des exceptions. Rien que des exceptions.
*/
public class Solution {
public static void main(String[] args) throws Exception {
try{ //écris ton code ici
methode1();
}
catch (NullPointerException e) {
//System.out.println("NullPointerException");
} catch (FileNotFoundException e) {
//System.out.println("FileNotFoundException");
}
//écris ton code ici
}
public static void methode1() throws NullPointerException, ArithmeticException, FileNotFoundException, URISyntaxException {
int i = (int) (Math.random() * 4);
if (i == 0)
throw new NullPointerException();
if (i == 1)
throw new ArithmeticException();
if (i == 2)
throw new FileNotFoundException();
if (i == 3)
throw new URISyntaxException("", "");
}
}