数组问题
import java.util.*;
public class Test24{
public static void main(String[] args){
Point[] pts1=new Point[]{new Point(1,1),new Point(2,2,),new Point(3,3)};
Point[] pts2=new Point[3];
System.arraycopy(pts1,0,pts2,0,pts1.length);
for(int i=0;i<pts1.length;i++){
System.out.println("pts2["+i+"].x="+pts2[i].x+"pts2["+i+"].y="+pts2[i].y);
}
}
}
class Point{
int x;
int y;
Point(int x,int y){
this.x=x;
this.y=y;
}
}
还有错误吗?我找不出来了