Here you can find the source of swap(Integer i, Integer j)
Parameter | Description |
---|---|
i | a parameter |
j | a parameter |
public static void swap(Integer i, Integer j)
//package com.java2s; //License from project: Open Source License public class Main { /**/*from w w w . ja va 2 s .co m*/ * @param i * @param j */ public static void swap(Integer i, Integer j) { System.out.println("i=" + i + ", j=" + j); if (i != j) { i ^= j; j ^= i; i ^= j; } System.out.println("i=" + i + ", j=" + j); } }