The left-hand side of an assignment must be a variable エラーが出る
以下のプログラムで、何故エラーが出てしまうのでしょうか。
▪️Test85.java
import java.util.function.*;
public class Test85 {
public static void main(String[] args) {
// Hero85 h = new Hero85();
(Cat85 c) -> {
return c.getHp();
}
}
}
▪️Cat85.java
public interface Cat85 {
public int hp;
Cat85() {
this.hp = 100;
}
public abstract int getHp() {
return this.hp;
}
}
▪️Error Log
The left-hand side of an assignment must be a variable
Multiple markers at this line
- Syntax error, insert "AssignmentOperator Expression" to
complete Expression
- Syntax error, insert ";" to complete BlockStatements
ご回答お願いします