Write a method which is used to swap the values of two memory locations by using a third variable.
67 Likes
void swap(int a, int b) { int c = a; a = b; b = c; System.out.println("a = " + a + "\t" + "b = " + b); }
Answered By
40 Likes
In what situation does a method return a value?
Differentiate between pure and impure methods.
Write a method which is used to swap the values of two memory locations without using a third variable.
Differentiate between call by value and call by reference.