public List subList( int fromIndex, int toIndex)
The from-index is inclusive and the to-index is exclusive.
To copy an entire vector, call with the arguments 0 and theVector.size().
import java.util.List;
import java.util.Vector;
public class MainClass {
public static void main(String args[]) {
Vector v1 = new Vector();
v1.add("A");
v1.add("B");
v1.add("C");
List l = v1.subList(1, 2);
for (int i = 0; i < l.size(); i++) {
System.out.println(l.get(i));
}
}
}
B