This program is used for swaping values ie interchanging one value with another eg: int a=9; int b=10; now interchange int a=10; int b=9; * also overloaded functions are explain ie having same name of function but different parameters used for it

16/03/2013 20:07

This is also the simple method of calling functions in main method

public class xyz
{
void swap(int a,int b)
{
int c;
c=a;
a=b;
b=c;
System.out.println(a);
System.out.println(b);
}
void swap()
{
int a=5;
int b=6;
int c;
c=a;
a=b;
b=c;
System.out.println(a);
System.out.println(b);
}
public static void main(String args[])
{
xyz obj=new xyz();
obj.swap(8,9);
xyz obj1=new xyz();
obj.swap();
}}