In Java 1.5 they added the ability to type Collections.
The syntax might be ArrayList<String> and now the ArrayList will only accept Strings - thus eliminating the need to cast Object back to the specific type.
It seems to me that an Object is pretty generic, so why is coding the specific type called a generic?
I suppose it doesn't matter what they call this new feature, unless there is something I don't understand about it - in which case it might be interesting to know why this feature is called generics.
Does anyone know why it's called generics?
The syntax might be ArrayList<String> and now the ArrayList will only accept Strings - thus eliminating the need to cast Object back to the specific type.
It seems to me that an Object is pretty generic, so why is coding the specific type called a generic?
I suppose it doesn't matter what they call this new feature, unless there is something I don't understand about it - in which case it might be interesting to know why this feature is called generics.
Does anyone know why it's called generics?