package collection;
public class Test{
public static void main(String[] args){
int a= 1;
String b = "hello";
Point p = new Point(1,2);
Collection c = new ArrayList();
c.add(p);
test(a,b,p,c);
System.out.println("a:"+a);
System.out.println("b:"+b);
System.out.println("p:"+p);
System.out.println("c:"+c);
}
public static void test( int a,String b,Point p,Collection c){
a = 2;
b=b+"world";
p.setX(3);
P = new Point(5,6);
c.clear();
c.add(p);
p.setY(7);
c = new ArrayList();
c.add(p);
}
}
JAVA集合存放得引用
最新推荐文章于 2022-08-08 14:29:09 发布