Is it possible to take objects like a Vector and make it have multiple generics? I know it’s possible when you create a class, but will other classes that come with the normal Java API (like Vectors, Stack, etc.) can have multiple generics?
For example:
Vector<String, Integer> vect = new Vector<String, Integer>();
vect.add("Hello!", 0);
From this, one index would have two values, a String and Integer.
Thanks in advance!!
The
Vectorclass implements a growable array of objects, I think you are looking for map,java.util.Map<key,value>, implementation of map isHashMap<k,v>