public class Root {
private double a,b,c,x1,x2;
private boolean hasRealRoots;
public Root(double a, double b, double c) {
super();
this.a = a;
this.b = b;
this.c = c;
}
public Root() {
super();
}
public double getA() {
return a;
}
public void setA(double a) {
this.a = a;
}
public double getB() {
return b;
}
public void setB(double b) {
this.b = b;
}
public double getC() {
return c;
}
public void setC(double c) {
this.c = c;
}
public double getX1() {
return x1;
}
public double getX2() {
return x2;
}
public boolean isHasRealRoots() {
return hasRealRoots;
}
public void computeRoots()
{
double delta = Math.pow(b, 2) - 4*a*c;
if(delta < 0)
{
this.hasRealRoots = false;
}
else
{
this.hasRealRoots = true;
this.x1 = (-b + Math.sqrt(delta)) / (2*a);
this.x2 = (-b - Math.sqrt(delta)) / (2*a);
}
}
}
public class app {
public app() {
// TODO Auto-generated constructor stub
}
public static void main(String[] args) {
// TODO Auto-generated method stub
double a,b,c;
a = Double.parseDouble(args[0]);
b = Double.parseDouble(args[1]);
c = Double.parseDouble(args[2]);
Root eg =new Root(a,b,c);
eg.computeRoots();
if(eg.isHasRealRoots())
{
System.out.println("x1 = " + eg.getX1() +
"\nx2 = " + eg.getX2());
}
else
{
System.out.println(a + "x^2 + " + b + "x" + " + " + c + "has no root!");
}
}
}



网上的方法都试过了,变量配置没问题,另一个类的编译也没问题,就是这个,到底是什么问题啊

求助
