hello i'm super stuck and cannot work out why this is not working. i'm trying to use inheritance and override but i keep getting this error. Been trying to figure this out for the past hour but have had no clue. i'm probably missing something silly, any help would be hugely grateful.
public class FlyingDragon extends Entity {
private int Hp;
public FlyingDragon(int x, int y, int Hp){
super (x, y);
this.Hp = Hp;
}
public void setHp(int Hp){
this.Hp = 100;
}
public int getHp(){
return Hp;}
public void setType(String type) { ###error is here
super.setType("Flying Dragon");}
}
public abstract class Entity {
private char symbol; // symbol that represents the entity
private String type; // every entity is of a type
private int x; // x coordinate in the room
private int y; // y coordinate in the room
public Entity (int x, int y) {
type = "entity";
this.x=x;
this.y =y;
}
public char getSymbol() {
return symbol;
}
public void setSymbol(char c) {
symbol = c;
}
public int getX() {
return x;
}
public int getY() {
return y;
}
public void setX (int newx) {
this.x=newx;
}
public void setY (int newy) {
this.y=newy;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
}