DEV Community 👩‍💻👨‍💻

Discussion on: Swap Values of Two Variables Without Any Helper Variable

Collapse
 
alexkapustin profile image
Oleksandr

Considering gc nature of java, it could be faster than using TMP var. It would be interesting to see some benchmarks :)

Collapse
 
luthfisauqi17 profile image
luthfisauqi17 Author

I agree with you. You know, you just gave me an idea, looks like in the future I'll be doing a performance analysis between swap techniques that use extra variables and those that don't. Thanks for the idea :)