swap,,

M

mai

Hello,

How can I write a swap routine with only call-by-sharing parameters?

Thank you in advance
 
D

Daniel Pitts

mai said:
Hello,

How can I write a swap routine with only call-by-sharing parameters?

Thank you in advance

No such think in Java.

Since parameters are always passed by reference, and the assignment
operator "=" will only assign primatives/references, you can't swap the
values the same way you can in C++.

At least, not generically.

A little more context into your specific problem might help us to give
you a way to do what you want to do.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,270
Messages
2,571,102
Members
48,773
Latest member
Kaybee

Latest Threads

Top