hi
*

public* *class* SweepMethod

{

 *public* *static* *void* main(String[] args)

{

*int* a;

*int* b;

a = Integer.*parseInt*(args[0]);

b = Integer.*parseInt*(args[1]);

System.*out*.println("Value in Main Method :"+a);

System.*out*.println("Value in Main Method :"+b);

*sweepValue*(a,b);

}

*static* *void* sweepValue(*int* a,*int* b)

{

*int* c;

c=a;

a=b;

b=c;

System.*out*.println("Value in sweepValue Method :"+a);

System.*out*.println("Value in sweepValue Method :"+b);

}

}


On Wed, Apr 22, 2009 at 2:28 PM, CIA <[email protected]> wrote:

> public static void main(String[] args) {
>         int a = 8;
>         int b = 5;
>         System.out.println("Before: a = " + a + ", b = " + b);
>         swap(a, b);
>         System.out.println("After: a = " + a + ", b = " + b);
> }
>
> Both After and Before, a = 8, b = 5
>
> Can anyone help me to create *swap* method to solve my problem?
> Thanks! :)
>
> >
>


-- 
With Regards,

Malti Sharma

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/javaprogrammingwithpassion?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to