Java Class New Instance newInstance(Class clazz, Class[] args, Object[] objects)

Here you can find the source of newInstance(Class clazz, Class[] args, Object[] objects)

Description

new Instance

License

Open Source License

Declaration

public static Object newInstance(Class<?> clazz, Class<?>[] args, Object[] objects) 

Method Source Code

//package com.java2s;
/**//from  ww w . ja  v a 2s . c o m
 * 
 * This software is part of the MaterialAPI
 * 
 * This api allows plugin developers to create on a easy way custom
 * items with a custom id and recipes depending on them.
 * 
 * MaterialAPI is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or 
 * any later version.
 *  
 * MaterialAPI is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with MaterialAPI. If not, see <http://www.gnu.org/licenses/>.
 * 
 */

public class Main {
    public static Object newInstance(Class<?> clazz, Class<?>[] args, Object[] objects) {
        try {
            return clazz.getConstructor(args).newInstance(objects);
        } catch (Exception ex) {
        }

        return null;
    }
}

Related

  1. newInstance(Class clazz)
  2. newInstance(Class clazz)
  3. newInstance(Class clazz)
  4. newInstance(Class clazz)
  5. newInstance(Class clazz)
  6. newInstance(Class clazz, Object... args)
  7. newInstance(Class clazz, Object... args)
  8. newInstance(Class cls)
  9. newInstance(Class cls)