I'm getting an error that I can't understand. I defined the class Couple in Java this way :
public class Couple<T1, T2>{
private T1 t1;
private T2 t2;
public Couple(T1 t1, T2 t2) {
this.t1 = t1;
this.t2 = t2;
}
public Couple() {
this.t1 = null;
this.t2 = null;
}
public T1 getFirst(){return t1;}
public T2 getSecond(){return t2;}
}
And in an another class, I try to define an array this way :
Couple<byte[], byte[]>[] res = new Couple<byte[], byte[]>[10];
But Eclipse tells me the error "Cannot create a generic array of Couple<byte[], byte[]> "
.
Well, the thing that I don't understand is that I mentionned that I wanted a couple of byte[], so there is no genericity at this point, am I wrong ?