diff --git a/GitBestPractices/src/de/hs_mannheim/informatik/gitdemo/Main.java b/GitBestPractices/src/de/hs_mannheim/informatik/gitdemo/Main.java index b00d497..ed2c1fb 100644 --- a/GitBestPractices/src/de/hs_mannheim/informatik/gitdemo/Main.java +++ b/GitBestPractices/src/de/hs_mannheim/informatik/gitdemo/Main.java @@ -4,6 +4,21 @@ public class Main { public static void main(String[] args) { System.out.println("Hallo Welt!"); + + Main m = new Main(); + + System.out.println(); + System.out.printf("Die Summe von %d + % d = %d", 3, 8, m.add(3, 8)); + System.out.printf("Es geht noch besser: %d + %d + %d = %d", 2, 5, 9, m.add(2, 5, 9)); + } + + public int add(int... numbers) { + int res = 0; + + for (int n : numbers) + res += n; + + return res; } -} +} \ No newline at end of file