我想从name,call构造函数创建类对象并创建新实例.但我不知道如何将参数发送给构造函数.我的基类是:
public carDao(ConnectionSource connectionSource, Class<Car> dataClass) throws SQLException
{
super(connectionSource, dataClass);
}
Run Code Online (Sandbox Code Playgroud)
和我想做的事情:
Class myClass = Class.forName("carDao");
Constructor intConstructor= myClass.getConstructor();
Object o = intConstructor.newInstance();
Run Code Online (Sandbox Code Playgroud)
我应该在getConstructor()中写什么?
我需要以某种方式在浮点之前得到一个数字并在该浮点之后得到值.例:
之前:21 2.12345 ;
之后:2.12345
有任何想法吗?