public class SwapTest {
/**
* @param args
*/
public static void main(String[] args) {
int a = 3, b = 4;
swap(a,b);
System.out.println(a+","+b);
Integer a1 = new Integer(3);
Integer b1 = new Integer(4);
swap(a1,b1);
System.out.println(a1+","+b1);
}
//空白处拿反射怎么做?
// 交换a和b的值
public static void swap(int a, int b){
}
// 交换a和b的值
public static void swap(Integer a, Integer b){
}
}
|