日期:2014-05-20 浏览次数:20581 次
public class Test
{
public static <T> void swap(T a,T b)
{
T temp = a;
a = b;
b = temp;
}
public static void main(String[] args) throws Exception
{
Integer a = new Integer("333");
Integer b = new Integer("555");
swap(a,b);//怎么没有交换,a,b都是对象啊,是引用类型
println(a+","+b);
}
}