2 Replies Latest reply on Mar 3, 2010 11:37 AM by walterln

    how to inherit generic constructor

      I have a super class with below generic constructor:
      public class Super {
           public Super(){}
           public <T extends Collection<?>> Super( T sub){
                // Do something
      I hope all the sub classes of Super will inherit this constructor and will accept a collection of its sub classes, so I have:
      public class Sub extends Super {
      but when initiating the Sub class with a List<Sub>:
      List<Sub> x = null;
      Sub sub = new Sub(x);
      I met compiler error: the constructor Sub(List<Sub>) is undefined.