Return type function

in swap function we swap two variable .now i want to return these 2 variable in main function . is it possible to return more than one variable in java.

Hi Aditya,
It is not possible to return 2 variables in java but if you want to make changes you had made in the values of variable persist in main function you have to make one variable global and static and return other variable.