getClass() in abstract class gives Ambiguous method call

后端 未结 5 1586
北海茫月
北海茫月 2021-01-31 13:39

I have a public abstract class and I\'m trying to use the getClass() method, as I will need info from the class extending my abstract class. An example is this:

5条回答
  •  南方客
    南方客 (楼主)
    2021-01-31 14:20

    The code is fine, but it is an error in IntelliJ.

    Error report, another one.

    There are even some more error reports with different variations of this issue. As duffymo pointed out in comments, it can also be because there are different versions of the JDK in the classpath.

提交回复
热议问题