Correction in the swapping programme,
July 27, 2009 at 11:26 PM
public class Swapping{ static void swap(int i,int j){ int temp=i; i=j; j=temp; System.out.println("After swapping i = " + i + " j = " + j); } public static void main(String[] args){ int i=1; int j=2;
in this example u have mentioned the value of the two number is swap but it is to remind you that what u have done u have printed the value from the class method that is not main it is swap method and when u call the method swap in the main the value should be printed as swapped from main....
my meaning is simple that after calling the method swap in main try to print the values from the main method then u will get the answer that is not having the swap values.........