Hello,
I started my coding hobby year ago wit jdk 6. Generics have been supported since jdk 5 so I never had bad problems using and adding multiple objects, for example, in shooting games because I was able to use ArrayLists and LinkedLists when I wanted to add multiple shots (like shooting with machine gun).
(My question comes after this example:)
For example I painted all the machine gun bullet objects just with this simple code:
for (Bullet b : bullet){
b.paint(g);
}
and in Thread there was something like this:
for( Bullet b : bullet){
b.move();
}
and I added new bullets in Keypressed like this:
bullet.add(new Bullet(some,parameters);
Now my question is that how things were done before the generics? I am doing one mobile shooting game and I cannot use generics in that. Creating many bullet objects without collections would be very time consuming.
I hope some on can help me with this.