中国网管论坛's Archiver

木木 发表于 2007-11-21 23:23

代码部分请会员学习使用插入代码功能

前提:发现很多会员直接是复制贴粘过来,或者直接就这样写好贴出来,为了规范论坛格式,请各位习惯学习使用:插入代码功能。

使用:在编辑框的上方有这个按钮[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]

active1234 发表于 2007-11-21 23:26

第一个支持,沙发呀!:lol

franham 发表于 2007-11-22 03:24

[attach]59986[/attach]

卡卡同学 发表于 2007-11-22 06:16

eo

知道鸟

zhstar 发表于 2007-11-22 08:29

:loveliness: 晓得了

caniny 发表于 2007-11-22 13:40

:PP:  ,收到。

yoochina 发表于 2007-11-22 14:19

:handshake
俺是小菜鸟。。

nelson0302 发表于 2007-11-22 14:21

[code]呵呵 明白[/code]

zwcm 发表于 2007-11-22 15:55

嘿嘿,明白

QQ510002030 发表于 2007-11-22 20:16

听明白了  这样好

lj10940020 发表于 2007-11-23 10:46

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(){}
                        }

a5781612 发表于 2007-11-23 12:04

听明白了  这样好

KWMVMWK 发表于 2007-11-24 05:02

我来说

恩哼,晓得了!

dragonlai 发表于 2007-11-24 08:38

晓得了
[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]

szyangwu 发表于 2007-11-24 16:07

明白

luckyboy1226 发表于 2007-11-25 09:10

理解!!!!

cangsangkk 发表于 2007-11-25 09:55

没明白,是什么意思啊?

基努李维 发表于 2007-11-26 11:52

支持下了

6680919 发表于 2007-11-26 15:10

谢谢

pengjh1015 发表于 2007-11-26 20:20

:handshake

页: [1] 2 3 4 5

Powered by Discuz! Archiver 6.1.0  © 1999-2008 bbs.bitsCN.com