class jj<T> {
T ob;
jj(T ob) {
this.ob = ob;
}
void show() {
System.out.println(ob);
}}
class demo {
public static void main(String[] args) {
// jj<Integer>[] lol=new jj<Integer>[10];// Not Allowed
jj<Integer>[] lol = new jj[10];//But this is allowed why?
for (int i = 0; i < 10; ++i)
lol[i] = new jj<>(i * 10);
for (jj<Integer> x : lol)
x.show();
}
Why the above code is allowed if generics arrays are not allowed in java? plz help!