面试题目,求大神解答
经年JN 2014-05-11 11:45:43 /**
* 请补充swap方法
*/
public class T3 {
public static void main(String[] args) {
Integer x = new Integer(1);
Integer y = new Integer(2);
swap(x, y);
int x1 = 1;
int y1 = 2;
swap(x1, y1);
System.out.println("x=" + x + ",y=" + y); // 要求输出x=2,y=1
System.out.println("x1=" + x + ",y1=" + y); // 要求输出x1=2,y1=1
}
public static void swap(Integer a, Integer b) {
}
public static void swap(int a, int b) {
}
}