class
swap1
{
int a,b;
void GetAll(int i,int j)
{
a=i;
b=j;
}
void swap()
{
a=a+b;
b=a-b;
a=a-b;
}
void ShowAll()
{
System.out.println("a="+a+","+"b="+b);
}
}
class
swapf
{
public static void main(String
args[])
{
swap1 ob=new swap1();
ob.GetAll(2,3);
ob.swap();
ob.ShowAll();
}
}
No comments:
Post a Comment