[code]package hello;
public class Cubo {
private double diagonalb,diagonalc,areal,areab,areat,volume;
public double getAreab() {
return areab;
}
public void setAreab(double areab) {
this.areab = areab;
}
public double getAreal() {
return areal;
}
public void setAreal(double areal) {
this.areal = areal;
}
public double getAreat() {
return areat;
}
public void setAreat(double areat) {
this.areat = areat;
}
public double getDiagonalb() {
return diagonalb;
}
public void setDiagonalb(double diagonalb) {
this.diagonalb = diagonalb;
}
public double getDiagonalc() {
return diagonalc;
}
public void setDiagonalc(double diagonalc) {
this.diagonalc = diagonalc;
}
public double getVolume() {
return volume;
}
public void setVolume(double volume) {
this.volume = volume;
}
public double diagonalBase(double aresta){
this.diagonalb = aresta * Math.sqrt(2);
return(this.diagonalb);
}
public double diagonalCubo(double aresta){
this.diagonalc = aresta * Math.sqrt(3);
return(this.diagonalc);
}
public double areaLateral(double aresta){
this.areal = 4 * aresta * aresta;
return(this.areal);
}
public double areaTotal(double aresta){
this.areat = 6 * aresta * aresta;
return(this.areat);
}
public double areaBase(double aresta){
this.areab = aresta * aresta;
return(this.areab);
}
public double volume(double aresta){
this.volume = aresta * aresta * aresta;
return(this.volume);
}
public Cubo(double aresta){
areaBase(aresta);
areaLateral(aresta);
areaTotal(aresta);
volume(aresta);
diagonalBase(aresta);
diagonalCubo(aresta);
}
public void Cubo(){}
}[/code]
Esse é o erro :
cannot find symbol
symbol : method sqrt(int)
location: class java.lang.Math
this.diagonalb = aresta * Math.sqrt(2);
C:\Users\Rafael\Documents\NetBeansProjects\Matematica\src\hello\Cubo.java:57: cannot find symbol
symbol : method sqrt(int)
location: class java.lang.Math
this.diagonalc = aresta * Math.sqrt(3);
C:\Users\Rafael\Documents\NetBeansProjects\Matematica\src\hello\HelloMIDlet.java:107: cannot find symbol
symbol : variable Double
location: class hello.HelloMIDlet
Cubo cubo = new Cubo(Double.parseDouble(textField.getString()));
C:\Users\Rafael\Documents\NetBeansProjects\Matematica\src\hello\HelloMIDlet.java:107: internal error; cannot instantiate Cubo(double) at hello.Cubo to ()
Cubo cubo = new Cubo(Double.parseDouble(textField.getString()));
C:\Users\Rafael\Documents\NetBeansProjects\Matematica\src\hello\HelloMIDlet.java:108: cannot find symbol
symbol : variable Double
location: class hello.HelloMIDlet
textField1.setString(Double.toString(cubo.getAreab()));
C:\Users\Rafael\Documents\NetBeansProjects\Matematica\src\hello\HelloMIDlet.java:109: cannot find symbol
symbol : variable Double
location: class hello.HelloMIDlet
textField2.setString(Double.toString(cubo.getAreal()));
C:\Users\Rafael\Documents\NetBeansProjects\Matematica\src\hello\HelloMIDlet.java:110: cannot find symbol
symbol : variable Double
location: class hello.HelloMIDlet
textField3.setString(Double.toString(cubo.getAreat()));
C:\Users\Rafael\Documents\NetBeansProjects\Matematica\src\hello\HelloMIDlet.java:111: cannot find symbol
symbol : variable Double
location: class hello.HelloMIDlet
textField4.setString(Double.toString(cubo.getVolume()));
C:\Users\Rafael\Documents\NetBeansProjects\Matematica\src\hello\HelloMIDlet.java:112: cannot find symbol
symbol : variable Double
location: class hello.HelloMIDlet
textField5.setString(Double.toString(cubo.getDiagonalb()));
C:\Users\Rafael\Documents\NetBeansProjects\Matematica\src\hello\HelloMIDlet.java:113: cannot find symbol
symbol : variable Double
location: class hello.HelloMIDlet
textField6.setString(Double.toString(cubo.getDiagonalc()));
10 errors
DefaultCldcJtwiPhone1: The following error occurred while executing this line:
C:\Users\Rafael\Documents\NetBeansProjects\Matematica\nbproject\build-impl.xml:1325: The following error occurred while executing this line:
C:\Users\Rafael\Documents\NetBeansProjects\Matematica\nbproject\build-impl.xml:368: Compile failed; see the compiler error output for details.
C:\Users\Rafael\Documents\NetBeansProjects\Matematica\nbproject\build-impl.xml:1341: The following error occurred while executing this line:
C:\Users\Rafael\Documents\NetBeansProjects\Matematica\nbproject\build-impl.xml:1322: Keepgoing execution: 1 of 1 iterations failed.
FALHA NA CONSTRUÇÃO (tempo total: 0 segundos)
Obrigado desde já