/**
Falscher Ansatz, um Werte zu tauschen: Wertparameter!

Das Programm liefert folgende Ausgabe:

main:     alte Werte : x=10, y=12
tausche:  alte Werte : a=10, b=12
tausche:  neue Werte : a=12, b=10
main:     neue Werte : x=10, y=12

*/
/*-----------------------------------------------------------------------*/

class Tausche_falsch
{
   /**
   *  Tauscht Inhalt zweier Variablen (per Wertübergabe)<BR>
   *  <b>falscher Ansatz</b>
   *  @param a erste Variable
   *  @param b zweite variable
   */
   static void tausche(long a,long b)
   {  long h=a;
      System.out.println("tausche:  alte Werte : a="+a+", b="+b);
      a=b;
      b=h;
      System.out.println("tausche:  neue Werte : a="+a+", b="+b);
   }

   /**
   *  Testumgebung für tausche<br>
   *  zwei long-Zahlen sollen vertauscht werden
   */    
   public static void main(String[] argv)
   {  long x=10,y=12;
   // "falscher" Tausch      
      System.out.println("main:     alte Werte : x="+x+", y="+y);
      tausche(x,y);
      System.out.println("main:     neue Werte : x="+x+", y="+y);
   }
}

