Java tutorial
//package com.java2s; import java.util.Vector; public class Main { public static <K> K getElementAt(Vector<K> vec, int index) { if (vec.size() <= index) { vec.setSize(index + 10); return null; } return vec.elementAt(index); } }