Simple Java program to Swap values

In this post, I would like to share two simple program which swap value stored in two variables. In the first program, uses an extra variable to perform swapping and in the second program there is no additional variable used. These two program uses two variable a and b to hold the values inserted by user. After processing the value in variables get replaced by each other. That is the value in a get replace by the value in b and the value in b get replaced by the value in a. For instance if user inserts 10 and 25 into the variable a and b respectively, after process the variable a will have 25 and b will have 10. To perform this operation, normally,we need an extra variable which holds the value in variable either the value in a or in b. If we store the value in a to the additional variable, say s, then we can replace a with b's value. Now, we have variable a