【发布时间】:2010-10-13 04:45:42
【问题描述】:
class Position {
private double x,y;
private int id;
public String toString(Position a){
String words ="(" + a.x + "," +a.y + ")";
return words;
所以我在这里返回了一个内存地址。我究竟做错了什么?我想获取使用 setter 设置的 x 和 y 的实际值。我也有吸气剂,我尝试不放 a.x 放 getX(),但这仍然给了我另一个内存地址。我做错了什么?
【问题讨论】: