I am currently in the process of developing a character generation mechanism for a Java based text game but I’ve ran into a issue and cannot see where I may have gone wrong. I have a “Character” class, which is abstract and then another class, “NPCharacter” which is meant build on top of this.
public abstract class Character {
public abstract void generateStats();
}
public class NPCharacter extends Character {
public void generateStats() {
}
}
Eclipse says that “The type NPCharacter cannot subclass the final class Character”. Can anyone see the error here?
Thanks in advance.
The compiler is confusing your
Characterwithjava.lang.Character. Just use a package and make sure you import yourCharacter.and