1.参数传递的统一是值
2.构造方法
public class ParamTest
{
public void changePoint(Point point)
{
point = new Point();
point.x = 3;
point.y = 4;
}
public static void main(String[] args)
{
ParamTest pt = new ParamTest();
Point point = new Point();
pt.changePoint(point);
System.out.println(point.x);
System.out.println(point.y);
}
}
class Point
{
int x;//横坐标
int y;//纵坐标
}