fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. public class Main
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. int zahl1 = 1;
  13. int zahl2 = 3;
  14. int temp;
  15.  
  16.  
  17.  
  18. System.out.print("Zahl1: "+zahl1);
  19. System.out.println("\nZahl2: "+zahl2);
  20.  
  21.  
  22.  
  23.  
  24. temp = zahl1;
  25. zahl1= zahl2;
  26. zahl2 = temp;
  27.  
  28. System.out.println("\nTemporaerspeicher: "+temp);
  29.  
  30. System.out.print("\nZahl1: "+zahl1);
  31. System.out.println("\nZahl2: "+zahl2);
  32.  
  33.  
  34. }
  35. }
Success #stdin #stdout 0.11s 320576KB
stdin
Standard input is empty
stdout
Zahl1: 1
Zahl2: 3

Temporaerspeicher: 1

Zahl1: 3
Zahl2: 1