This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes swap() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "swap()" Watch "swap()" New topic
Author

swap()

shree vijay
Ranch Hand

Joined: Sep 18, 2000
Posts: 208
Hi,
Is there any equivalent to swap(i,j) in Java?
Thanks,
Shree

Regards,<BR>Shree
Stephanie Grasson
Ranch Hand

Joined: Jun 14, 2000
Posts: 347
Shree,
To swap values within a function, use single-element arrays. See example below:


Hope this helps.
Stephanie
Stephanie Grasson
Ranch Hand

Joined: Jun 14, 2000
Posts: 347
Shree,
To swap values within a function, use single-element arrays. See example below:


Hope this helps.
Stephanie
shree vijay
Ranch Hand

Joined: Sep 18, 2000
Posts: 208
Thanks Stephanie,
I was curious to know if there was any method equivalent for swap... Just plain lasy ...
Shree
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: swap()
 
Similar Threads
swap the xml thorugh java class
The Ultimate Reality show
concurrent bubble sort
move row in table
IiPAS6.5) kjs log shows java.lang.NoSuchMethodError