Swap the value of two variables
public class Swap { public static void main(String args[]) { int a = 5;//from www .ja va 2 s.c o m int b = 7; int temp = a; a = b; b = temp; System.out.println(a); System.out.println(b); } }