Java Class New Instance newInstance(String aclass)

Here you can find the source of newInstance(String aclass)

Description

new Instance

License

Open Source License

Declaration

public static Object newInstance(String aclass) throws RuntimeException 

Method Source Code

//package com.java2s;

public class Main {
    public static Object newInstance(String aclass) throws RuntimeException {
        try {/*from w  ww . j a  v a  2s . co  m*/
            Class<?> lClass = Class.forName(aclass);
            Object instance = lClass.newInstance();
            return instance;
        } catch (ClassNotFoundException cnfe) {
            throw new RuntimeException();
        } catch (InstantiationException insExp) {
            throw new RuntimeException();
        } catch (IllegalAccessException iExp) {
            throw new RuntimeException();
        }

    }
}

Related

  1. newInstance(final String className, final Object[] args)
  2. newInstance(final String fullyQualifiedClass)
  3. newInstance(Map> providerMap, String provider, Class[] paramsClass, Object[] paramValues)
  4. newInstance(Object bean, String propertyName, Class clazz)
  5. newInstance(ProceedingJoinPoint thisJoinPoint, Class clazz, Object... newArgs)
  6. newInstance(String className)
  7. newInstance(String className)
  8. newInstance(String className)
  9. newInstance(String className)