代码部分请会员学习使用插入代码功能
前提:发现很多会员直接是复制贴粘过来,或者直接就这样写好贴出来,为了规范论坛格式,请各位习惯学习使用:插入代码功能。使用:在编辑框的上方有这个按钮[img]http://bbs.bitscn.com/images/common/bb_code.gif[/img]点击一下,输入或粘贴,再排好版。
演示如下:
[code]Class aClass = Class.forName(xxx.xx.xx);
Object anInstance = aClass.newInstance();
Class.forName("").newInstance()返回的是object
but there is some limit for this method to create instance
that is your class constructor should no contain parameters,
and you should cast the instance manually.
Class Driver{
protected static Driver current;
public static Driver getDriver(){
return current;
}
}
Class MyDriver extends Driver{
static{
Driver.current=new MyDriver();
}
MyDriver(){}
}
[/code] 第一个支持,沙发呀!:lol [attach]59986[/attach]
eo
知道鸟 :loveliness: 晓得了 :PP: ,收到。 :handshake俺是小菜鸟。。 [code]呵呵 明白[/code] 嘿嘿,明白 听明白了 这样好
23
Class aClass = Class.forName(xxx.xx.xx);Object anInstance = aClass.newInstance();
Class.forName("").newInstance()返回的是object
but there is some limit for this method to create instance
that is your class constructor should no contain parameters,
and you should cast the instance manually.
Class Driver{
protected static Driver current;
public static Driver getDriver(){
return current;
}
}
Class MyDriver extends Driver{
static{
Driver.current=new MyDriver();
}
MyDriver(){}
} 听明白了 这样好
我来说
恩哼,晓得了! 晓得了[code]
Class aClass = Class.forName(xxx.xx.xx);
Object anInstance = aClass.newInstance();
Class.forName("").newInstance()返回的是object
but there is some limit for this method to create instance
that is your class constructor should no contain parameters,
and you should cast the instance manually.
Class Driver{
protected static Driver current;
public static Driver getDriver(){
return current;
}
}
Class MyDriver extends Driver{
static{
Driver.current=new MyDriver();
}
MyDriver(){}
}
[/code] 明白 理解!!!! 没明白,是什么意思啊? 支持下了 谢谢 :handshake