Hallo, ich frage mich gerade, was eine Ausnahmebehandlung in Methoden macht.
Im Folgenden Code kommt die selbe Meldung, wenn ich "throws ArithmeticException" weg lasse.
Im Folgenden Code kommt die selbe Meldung, wenn ich "throws ArithmeticException" weg lasse.
Java:
int a = 6;
int b = 0;
test(a,b);
}
private static void test(int a, int b) throws ArithmeticException{
int c;
c = a/b;
System.out.println(c);}