i see some examples in java where vectors are declared as
Vector v = new Vector()
and in some examples,
Vector<String> = new Vector<String>()
i am not sure what does the latter declaration do? does it specify the type of Objects the Vector shud consist of?
if yes, then if i declare a Vector using the first declaration i can use any type of Objects and if i use the second declaration, then the object can only be of type within <>?
The first line defines a
VectorofObjects that can be of any type.The second line uses Java Generics und define a
Vectorthat only holdsStrings.