/* * Einfaches Beispiel zu Methodenaufrufen * * Die Ausgaben in den max-Methoden * dienen nur zum besseren Verständnis */ class MaxDemo { static int max (int x, int y) { // System.out.println("Ich bin static int max (int x, int y)"); // System.out.println("\tMeine Variablen: x="+x+", y="+y); if (x>y) { return(x); } else { return(y); } } public static void main (String[] arg) { int ergebnis=0; System.out.println("Aufruf: max(45,98)"); ergebnis = max(45,98); System.out.println("Ergebnis: " + ergebnis); System.out.println("Aufruf: max(45,13)"); ergebnis = max(45,13); System.out.println("Ergebnis: " + ergebnis); } }