Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.lang.reflect.Constructor;

public class Main {
    private static Object getInstance(String name, Class<?> classParas[], Object paras[]) {
        Object o = null;
        try {
            Class<?> c = Class.forName(name);
            Constructor<?> con = c.getConstructor(classParas);
            o = con.newInstance(paras);
        } catch (Exception ex) {
        }

        return o;
    }
}