I have the following code:
public class I<T> {
private T t;
public I(T t) {
this.t=t;
}
}
public class G<T> {
private I<T> tab[];
public G() {
tab=(I<T>[]) new Object[10];
}
}
Calling G() throws a ClassCastException.
How could I code the G constructor in order to initialize tab?