March 21, 2019

Swapping Two Numbers

Swapping two numbers without using a new variable is always a good approach. This helps your application to be memory and performance oriented. public class Swap2Numbers{ int firstNum = 10; int secondNum = 20; public static void main(String args[]) { Swap2Numbers swap2Numbers = new Swap2Numbers(); swap2Numbers.proceed(); } private void proceed()