code: public static Object newInstance(String s)
      {
          final ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
  
          try
          {
              Class< ? > clazz = classLoader.loadClass(s);
              Constructor< ? > constructor = clazz.getConstructor();
              return constructor.newInstance();
          }
          catch (ClassNotFoundException e)
          {
              return null;
          }
          catch (IllegalAccessException e)
          {
              return null;
          }
          catch (InstantiationException e)
          {
              return null;
          }
          catch (NoSuchMethodException e)
          {
              // no default constructor
              return null;
          }
          catch (InvocationTargetException e)
          {
              // constructor threw an exception
              return null;
          }
      }
docs: Creates a new instance of the given class. The class is loaded using the
  current thread's context class loader and instantiated using its default
  constructor.
  
  @param s fully qualified name of the class to instantiate.
  @return the new instance or <code>null</code> on failure.