<pre name="code" class="java"><span style="font-size:18px;">一.有参构造函数 实例化对象
</span>
<span style="font-size:18px;">cls = Class.forName(className);
Class<?>[] paramTypes = { FragmentManager.class };
Object[] params = {getSupportFragmentManager()};
Constructor<?> con = cls.getConstructor(paramTypes);
adapter = ((OrderTypePagerAdapter)con.newInstance(params))
</span>
<span style="font-size:18px;">
</span>
<span style="font-size:18px;">二.调用<span style="font-family: Arial; font-size: 14px; line-height: 26px;">static方法</span></span>
<span style="font-size:18px;">Class<?> cls = Class.forName(className);
Method method = cls.getDeclaredMethod("newInstance");
method.invoke(cls);</span>
<span style="font-size:18px;"><span style="font-family: Arial; font-size: 14px; line-height: 26px;">
</span></span>