Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

java swap variables

// a, b can be a numeric value
a += b; // a = a + b
b = a - b; // b = (a + b) - b = a  ---> b=a
a -= b; // a = (a + b) - (a) = b  ---> a=b
Source by www.sololearn.com #
 
PREVIOUS NEXT
Tagged: #java #swap #variables
ADD COMMENT
Topic
Name
2+2 =