-2
このメソッドは親クラスにあり、 "getEasterAttack"という名前です。 "Method Call Expected"エラーがどのように発生したかをninjaGetDamageRecievedという別のクラスで呼び出しようとしています。それは私のメソッドシグネチャの受信がintを要求していないためですか?または私のアクセス修飾子のためですか?ヘルプIntelliJの究極の "メソッド呼び出しが必要"を使用しているエラー
public int getEasterAttack() {
int shark = 100;
int randnum = RandInt.randomInt(0, 125);
if (randnum == getHealth()) {
}
return shark;
public int ninjaDamageReceivedCalculator(int rawDamageDealt) {
int damage = 0;
int protection = 0;
if (getPlayerWeapon().equalsIgnoreCase("blade")) {
damage = rawDamageDealt - (getRandomBladeRangeProtection() * getRandomAccuracyDamage());
} else {
damage = rawDamageDealt - (getRandomStarRangeProtection() * getRandomAccuracyDamage());
}
if (rawDamageDealt > protection + getForestProtection()) {
damage = rawDamageDealt - (protection + getForestProtection());
}
this.removeHealth(damage);
return damage(getEasterAttack());
}
*クラス*の名前は* getEasterAttack *ですか?そして、別のクラスは* ninjaDamangeReceivedCalculate *と呼ばれますか?あなたのユースケースでは無効です – Li357
'' damage(getEasterAttack()) 'は何をすると思いますか? – azurefrog
'getEasterAttack'ファンクションの括弧を閉じることから始めることができます – smac89