Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.util.Vector;

public class Main {
    public static <K> K setElementAt(Vector<K> vec, int index, K value) {
        K retVal;
        if (vec.size() <= index) {
            vec.setSize(index + 10);
            retVal = null;
        } else
            retVal = vec.elementAt(index);
        vec.setElementAt(value, index);
        return retVal;
    }
}