Why is it that in so many books they would say something along this line:
private E[] data;//E is a generic type
public ArrayList(int capacity){
data = (E[]) new Object[capacity];//safe casting
}
instead of saying
data = new E[capacity];
why use safe casting when you can just declare it this way? does it have anything to with the fact that generic data will be declared during runtime instead of compile time? or does it more or less make no difference??