Swapping of Numbers with and without Temporary Variable using Java

The preceding Java code is for swapping of numbers. 
  1. import java.util.Scanner;  
  2. import java.io.BufferedReader;  
  3. import java.io.InputStreamReader;  
  4. import java.io.IOException;  
  5. class Swapping {  
  6.     public static void main(String args[]) throws Exception {  
  7.         try {  
  8.             BufferedReader br = new BufferedReader(new InputStreamReader(System. in ));  
  9.             System.out.println("1-Swapping with temp variable");  
  10.             System.out.println("2-Swapping without temp variable");  
  11.             System.out.println();  
  12.             System.out.print("Select any option: ");  
  13.             int select = Integer.parseInt(br.readLine());  
  14.             switch (select) {  
  15.                 case 1:  
  16.                     int x, y, temp;  
  17.                     System.out.print("Enter x and y: ");  
  18.                     Scanner input = new Scanner(System. in );  
  19.                     x = input.nextInt();  
  20.                     y = input.nextInt();  
  21.                     System.out.println("Before Swapping\nx = " + x + "\ny = " + y);  
  22.                     temp = x;  
  23.                     x = y;  
  24.                     y = temp;  
  25.                     System.out.println("After Swapping\nx = " + x + "\ny = " + y);  
  26.                     break;  
  27.                 case 2:  
  28.                     int a, b;  
  29.                     System.out.print("Enter x and y: ");  
  30.                     Scanner in = new Scanner(System. in );  
  31.                     a = in .nextInt();  
  32.                     b = in .nextInt();  
  33.                     System.out.println("Before Swapping\nx = " + a + "\ny = " + b);  
  34.                     a = a + b;  
  35.                     b = a - b;  
  36.                     a = a - b;  
  37.                     System.out.println("After Swapping\nx = " + a + "\ny = " + b);  
  38.                     break;  
  39.                 default:  
  40.                     System.out.println("Wrong choice");  
  41.             }  
  42.         } catch (IOException e) {  
  43.             System.out.println("main method:" + e);  
  44.         }  
  45.     }  
  46. }  
Thank you, keep learning and sharing .