Java - ' ) ' erwartet Fehler

Balg ist Teil eines code, den ich mache, berechnet Volumen. Ich bin immer der "' ) 'erwartet Fehler" 2 mal. Erste auf -> if (solidom.equalsIgnoreCase("esfera"){ , und der zweite auf -> if (solidom.equalsIgnoreCase("cilindro") { . Kann mir jemand helfen? :/

private static double volume(String solidom, double alturam, double areaBasem, double raiom) {
double vol;

    if (solidom.equalsIgnoreCase("esfera"){
        vol=(4.0/3)*Math.pi*Math.pow(raiom,3);
    }
    else {
        if (solidom.equalsIgnoreCase("cilindro") {
            vol=Math.pi*Math.pow(raiom,2)*alturam;
        }
        else {
            vol=(1.0/3)*Math.pi*Math.pow(raiom,2)*alturam;
        }
    }
    return vol;
}

InformationsquelleAutor Ricardo Almeida | 2013-11-03

Schreibe einen Kommentar