Generic swap: Difference between revisions

Content deleted Content added
No edit summary
Casebash (talk | contribs)
Line 402:
=={{header|Java}}==
{{works with|Java|1.5+}}
 
Java uses references, so it can't swap the values of two variables that don't belong to a class.
 
<lang java>class Pair<T> {
T first;