This commit is contained in:
Mykola Fesenko
2025-07-29 08:08:23 +02:00
commit 899a05907b
355 changed files with 11002 additions and 0 deletions

20
6/Aufgabe2.~ava Normal file
View File

@@ -0,0 +1,20 @@
import java.util.InputMismatchException;
import java.util.Scanner;
public class Aufgabe2 {
public static void main(String args[]) {
try {
System.out.println(berechneDivision(10,5));
} catch(IllegalArgumentException e) {
System.out.println(e.getMessage());
}
}
public static int berechneDivision(int a, int b){
if (b == 0){
throw new IllegalArgumentException("Der Nenner darf nicht Null sein");
}
int c = a/b;
return c;
}
}