If I have a Vector of generics :Vector<E> vect
in Java and I want to return a copy of the element in the position 'i' how can I do? If I am not wrong I think that when I use vect.get(i)
it will return a reference to the object in the in the position i instead of a copy of it.
PS: I know nothing about the type and the objects the vector contains (for example, if they have the method clone
, etc.).