我有一个公开的抽象阶级和Im试图使用getClass(
)方法,因为我需要从延长我的抽象阶级的那类人中提取信息。 例如:
public String getName() {
return getClass().getSimpleName();
}
However, IntelliJ reports this:
Ambiguous method call. Both
getClass () in Object and
getClass () in Object match.
The code runs fine, but having tens of error warnings in my IDE is kinda in my way. It disrupts my work flow with a lot of false positives.
Why are these errors shown, and what can I do to not see them?