Java Class New Instance newInstance(String className)

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

Description

new Instance

License

Apache License

Declaration

public static Object newInstance(String className) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static Object newInstance(String className) {
        try {/*from   www .j  a  v a  2 s. co m*/
            return Class.forName(className).newInstance();
        } catch (Exception e) {
            throw new RuntimeException("new instance fail : " + e.getMessage(), e);
        }
    }
}

Related

  1. newInstance(String className)
  2. newInstance(String className)
  3. newInstance(String className)
  4. newInstance(String className)
  5. newInstance(String className)
  6. newInstance(String className)
  7. newInstance(String className)
  8. newInstance(String className)
  9. newInstance(String className)