禁用 Smilies
禁用 Discuz!代码
使用个人签名
什么都是禁止的 要代码也没什么用 好象:(: 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(){}
}
本文来自: 中国网管论坛(bbs.bitsCN.com) 详细出处参考:[url]http://bbs.bitscn.com/143256[/url] 俺是新来的,学习学习 了解了 :lol 明白了,新手报到! 看不懂,能说详细一点吗?
收到
知道了,我以前杂其他网站就是这么做的. :funk: :funk: 还是看不懂······ 收到:o: :o: :o: 啊,原来如此 恩.明白.支持 明白了,谢谢