StefanTobler

Lesson 32 Activity 3

Dec 3rd, 2016
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.96 KB | None | 0 0
  1. /*
  2. * Lesson 32 Coding Activity 3
  3. *
  4. * For the Lesson 32 activities, you will be asked to write one or more methods.
  5. * Use the template to write a main method that tests each of your methods,
  6. * then paste everything into the code runner box. Your submission should
  7. * begin with the first import statement and end with the final }.
  8. *
  9. * Write a method that takes two integer parameters and prints them in reverse.
  10. *
  11. * This method must be called swap and should take two integer parameters.
  12. *
  13. * Calling swap(3, 7) would print 7 3.
  14. *
  15. */
  16.  
  17.  
  18. import java.util.Scanner;
  19.  
  20. class Lesson_32_Activity_Three {
  21.      
  22.          public static void swap(int x, int y)
  23.           {
  24.           System.out.println(y + " " + x);
  25.           }
  26.          
  27.        
  28.         public static void main(String[] args)
  29.          {
  30.           Scanner scan = new Scanner(System.in);
  31.           int x = scan.nextInt();
  32.           int y = scan.nextInt();
  33.           swap(y,x);
  34.          }
  35. }
Add Comment
Please, Sign In to add comment