public class point3d {
float x;
float y;
float z;
public point3d(float x, float y, float z){
this.x = x;
this.y = y;
this.z = z;
}
public point3d(){
x = 0;
y = 0;
z = 0;
}
public float getX(){
return x;
}
void setX(float x) {
this.x =x;
}
public float getY(){
return y;
}
void setY(float y) {
this.y =y;
}
public float getZ(){
return z;
}
void setZ(float z) {
this.z = z;
}
public String toString()
{
return "(" + x + ", " + y + "," + z + ")";
}
}
这是我编写的 point3d 类代码,我想通过这个 point3d 类读取多个点,这些点在主类中给出,我该如何实现。请帮助我?