Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.util.*;

public class Main {
    public static Vector arrayToVector(Object[] list) {
        Vector v = new Vector();
        for (int i = 0; i < list.length; i++)
            v.add(list[i]);
        return (v);
    }

    public static Vector arrayToVector(Object[][] list) {
        // Convert into a vector of vectors
        Vector v = new Vector();
        Vector subVector = null;
        for (int i = 0; i < list.length; i++) {
            subVector = new Vector();
            for (int j = 0; j < list[i].length; j++) {
                subVector.add(list[i][j]);
            }
            v.add(subVector);
        }
        return (v);
    }
}