import java.util.Scanner;
public class Point {
public double x;
public double y;
public double z;
Point(double a, double b, double c) {
x = a;
y = b;
z = c;
}
void setX(double a) {
x = a;
}
double getPoint(Point p) {
return (x - p.x) * (x - p.x) * (y - p.y) * (y - p.y) * (z - p.z)
* (z - p.z);
}
public static void main(String[] args) {
// TODO Auto-generated method stub
Point p = new Point(1.0, 2.0, 3.0);
Point p1 = new Point(0.0, 0.0, 0.0);
System.out.println(getPoint(p1));//getPoint()这个地方提示错误所有的都改成静态结果不对 求怎么改
p.setX(5.0);
System.out.println(p.getPoint(new Point(1.0, 1.0, 1.0)));
}
}
------解决方案--------------------
你的入口main是静态的而你的getPoint不是静态方法