java lab14a
Mon Oct 09 2023 09:35:39 GMT+0000 (Coordinated Universal Time)
Saved by
@viinod07
public class lab14
{
public static void main(String[] args)
{
int a=10;
int b=20;
System.out.println("values before the call a="+a+"b="+b);
swap(a,b);
System.out.println("value after the call a="+a+"b="+b);
}
public static void swap(int a,int b)
{
System.out.println("inside swap(),before swapping....");
System.out.println("a="+a+"b="+b);
int temp =a;
a=b;
b=temp;
System.out.println("inside swap after swapping a="+a+"b="+b);
}
}
content_copyCOPY
Comments