2

I've some issues trying to instantiate an array of templated type :

public class MyList<T extends Comparable<T>> {

  private T[] data;

  /**
   * Initializes the list
  **/
  public MyList() {
    data = new T[0];
  }

  // ...
}

I assume that the type of T is defined during runtime, isn't it ?

Regards,

Pyrrha
  • 139
  • 1
  • 11

0 Answers0