//Ruft 'FiboMethode' aufimport FiboMethode;public class RuftMethode{ public static void main(String[] arg) { FiboMethode fm = new FiboMethode(); //Wird nur fuer die Wiedergabe benoetigt int n = Integer.parseInt(arg[0]); //Parameteruebergabe an die Methode long fib = m.fibo(Integer.parseInt(arg[0])); //Ausgabe der Fibonaccizahl System.out.println("\nFibonacci(" + n + ") = " + fib + "\n\n"); } ---------------------------------------------------- //Kommunikation zweier Klassen //Wird von der Hauptklasse 'RuftMethode' aufgerufen public class FiboMethode { public long fibo(int n) { int i = 1; long x = 1, y = 1; if (n == 0 || n == 1) { return(1); } else { while (i < n) { x = x + y; y = x - y; i++; } return(x); } } } }