0

これが私がテストしようとしているクラスです:

package math;
import java.lang.Math;
public class Power {

public double powerFinder (double x, double y) 
    {

        return Math.pow(5, 4);

    }

}

テストは次のとおりです。

@Test

public double testPower() {

    Power power = new Power();
    assertEquals("Result", 625, power.powerFinder(5, 4), epsilon);
}

}

現時点では、Power 型のメソッド powerFinder(double) は引数 (int,int) には適用できません。テストが実行されるように、これを解決するにはどうすればよいですか?

4

3 に答える 3

0

コードを次のように変更します。

public double powerFinder (double x, double y); 
{

    return Math.pow(x, y);

}
于 2013-03-06T09:34:16.550 に答える