generics raw type
hi all!
I've made a small program and I didn't define A as a raw type so
I don't understand why this simple part of code is executed properly?
why method aka.add(new Integer(2)) works even if A is A<Boolean>
class A<E>{
int position;
Object field[];
public A(int size){
position=0;
field=new Object[size];
}
public <E>void add(E objekt){
field[position]=objekt;
position++;
}
void print(){
for(Object o: field)
System.out.println(">> " + o.toString()+" << ");
}
}
class generics{
publicstaticvoid main(String args[]){
A<Boolean> aka =new A<Boolean>(3);
aka.add(new Integer(2));
aka.add(new String("bok"));
aka.add(new Boolean(true));
aka.print();
}
}

