This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
No we cant fill any code here becoz the arguments are passed by values. So variable a and b are just the copy of variable x and y. And any modification made on the argument ie a and b will not be reflected in main variable x and y.
Dear Srinu, Nothing can be done at the method swap(int a, int b) to swap the values of x and y in main. This is because when u call the method swap(x,y); only the values of x and y are passed to the swap method and the values of x and y which are 10 and 20 are assigned to a and b respectively. Now there is no relationship between the variables a and b and the variables x and y. so wat ever operations u do on a and b will not in any means reflect x and y. Please let me know if further clarifications are needed.