Java Generics : Obtaining a Class>?

后端 未结 3 1405
北荒
北荒 2021-01-18 08:08

I\'m having trouble using generics. Given the following example :

class A {
  public A(Class myType){
  }
}

class B extends A<         


        
3条回答
  •  生来不讨喜
    2021-01-18 08:24

    class A {
        public A(Class myType){
        }
    }
    
    class B extends A> {
        public B(Class> myEType){ // <-- this is the changed line
            super(myEType);
        }
    }
    

提交回复
热议问题