Unusual generics behavior

    Accidentally discovered an atypical problem with parameterization and inheritance in Java.
    Immediately make a reservation that all this is only of academic interest . In real life, nobody will write so crookedly. But formally this should not be:
    public interface Interface {
        void test (Class clazz);

    public abstract class BaseClass implements Interface {
        abstract public void test(Class clazz);

    public class MyClass extends BaseClass {
        public void test(Class clazz) {
    Компилятор выдает ошибку:
    MyClass is not abstract and does not override abstract method test(java.lang.Class)

    Also popular now: