Swapping Values
In this exercise, you use what you have learned about swapping values to answer the following question.
1. Suppose you have declared and initialized two String variables, product1 and product2, in a Java program. Now, you want to swap the values stored in product]. and product2, but only if the value of product1 is greater than the value of product2. Remember that you do not use the equality operator ( ) when comparing String objects.
Write the Java code that accomplishes this task. The declarations are as follows:
String product1. - "hammer" ;
String product2 - "wrench":
_________________________________________________________________________________
_________________________________________________________________________________
_________________________________________________________________________________
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.