Java Class New Instance newInstance(Class clazz)

Here you can find the source of newInstance(Class clazz)

Description

new Instance

License

Open Source License

Declaration

public static <T> T newInstance(Class<? extends T> clazz) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static <T> T newInstance(Class<? extends T> clazz) {
        try {/* w w  w  .  j av  a 2s  . c  o m*/
            return clazz.newInstance();
        } catch (Exception e) {
            throw new RuntimeException("Cant create bean", e);
        }

    }
}

Related

  1. newInstance(Class cmdClass)
  2. newInstance(Class constructorClass, Object[] parameters)
  3. newInstance(Class klass)
  4. newInstance(Class targetClass)
  5. newInstance(Class cl, Object[] args)
  6. newInstance(Class componentType, int length)
  7. newInstance(Class classZ)
  8. newInstance(Class clazz)
  9. newInstance(Class clazz)