I am taking my first Java course and I am stuck on my assignment which is the following:
Write a java program that prompts the user to input two integer values, swap the values of two variables (don’t just display them in opposite locations), and then display the swapped values back to the user.
I have an idea of what it is supposed to look like:
Please enter two values:
Value #1 = 1
Value #2 = 4
Value #1 = 4
Value #2 = 1
I understand that i have to use the Scanner object to get the user inputs and I understand how to prompt the user to insert values. What I really need help on is the "swapping" of the values and displaying them back to the user.
Any help is really appreciated. Thank You.