Given two double variables , bestValue and secondBestValue, write some code that swaps their values . Declare any additional variables as necessary.

Given two double variables , bestValue and secondBestValue, write some code that swaps their values . Declare any additional variables as necessary.

LANGUAGE: JAVA

CHALLENGE:

Given two double variables , bestValue and secondBestValue, write some code that swaps their values . Declare any additional variables as necessary.

SOLUTION:

double temp;

temp = bestValue;
bestValue = secondBestValue;
secondBestValue = temp;

Add comment