Code Below:
import java.util.*;
class swap
{
public static void main()
{
Scanner s=new Scanner (System.in);
System.out.println("Enter 2 integer type numbers");
int a=s.nextInt();
int b=s.nextInt();
System.out.println("Before Swapping A="+a);
System.out.println("Before Swapping B="+b);
a=a+b;
b=a-b;
a=a-b;
System.out.println("After Swapping A="+ a);
System.out.println("After Swapping B="+ b);
}
}