Java Generics : Obtaining a Class>?

后端 未结 3 1407
北荒
北荒 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:28

    Try this:

    class A {
      public A(Class myType){
      }
    }
    
    class B extends A> {
      public B(Class myEType){
        super(myEType);
      }
    }
    

    If satisfied, please mark this answer correct.

提交回复
热议问题