編程生活
::
首頁(yè)
::
新隨筆
::
聯(lián)系
::
聚合
::
管理
::
113 隨筆 :: 0 文章 :: 18 評(píng)論 :: 0 Trackbacks
<
2009年8月
>
日
一
二
三
四
五
六
26
27
28
29
30
31
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
1
2
3
4
5
留言簿
(5)
給我留言
查看公開(kāi)留言
查看私人留言
隨筆檔案
2013年8月 (1)
2013年7月 (2)
2012年6月 (4)
2012年5月 (1)
2012年4月 (2)
2012年3月 (1)
2012年2月 (1)
2009年8月 (2)
2009年1月 (1)
2008年12月 (2)
2008年8月 (2)
2008年6月 (8)
2008年4月 (2)
2008年3月 (1)
2008年1月 (4)
2007年12月 (6)
2007年11月 (15)
2007年10月 (17)
2007年9月 (7)
搜索
積分與排名
積分 - 186984
排名 - 310
最新評(píng)論
1.?re: eclipse.ini內(nèi)存設(shè)置
那4g內(nèi)存怎么配置?
--將i占
2.?re: log4j的ConversionPattern參數(shù)的格式含義
@輔導(dǎo)費(fèi)
呵呵
--eval
3.?re: log4j的ConversionPattern參數(shù)的格式含義
@Hacken
你猜。。
--輔導(dǎo)費(fèi)
4.?re: eclipse.ini內(nèi)存設(shè)置[未登錄](méi)
using...
--blue
5.?re: log4j的ConversionPattern參數(shù)的格式含義[未登錄](méi)
#1 定義了兩個(gè)輸出端
log4j.rootLogger = INFO, A1, A2,A3
此處怎么會(huì)是兩個(gè)輸出端呢???
--Hacken
java動(dòng)態(tài)創(chuàng)建Enum
public
class
DayFactory
{
static
{
try
{
Constructor con
=
Day.
class
.getDeclaredConstructors()[
0
];
Method[] methods
=
con.getClass().getDeclaredMethods();
for
(Method m : methods)
{
if
(m.getName().equals(
"
acquireConstructorAccessor
"
))
{
m.setAccessible(
true
);
m.invoke(con,
new
Object[
0
]);
}
}
Field[] fields
=
con.getClass().getDeclaredFields();
Object ca
=
null
;
for
(Field f : fields)
{
if
(f.getName().equals(
"
constructorAccessor
"
))
{
f.setAccessible(
true
);
ca
=
f.get(con);
}
}
Method m
=
ca.getClass().getMethod(
"
newInstance
"
,
new
Class[]
{ Object[].
class
}
);
m.setAccessible(
true
);
Day v
=
(Day) m.invoke(ca,
new
Object[]
{
new
Object[]
{
"
VACATION
"
, Integer.MAX_VALUE }
}
);
System.out.println(v.getClass()
+
"
:
"
+
v.name()
+
"
:
"
+
v.ordinal());
for
(Day day:Day.values())
{
System.out.println(day);
}
}
catch
(Exception ex)
{
ex.printStackTrace();
}
}
public
static
void
say()
{
}
@Test
public
void
ddd()
{
DayFactory.say();
}
posted on 2009-08-19 09:07
wilesun
閱讀(1511)
評(píng)論(0)
編輯
收藏
新用戶注冊(cè)
刷新評(píng)論列表
只有注冊(cè)用戶
登錄
后才能發(fā)表評(píng)論。
網(wǎng)站導(dǎo)航:
博客園
IT新聞
Chat2DB
C++博客
博問(wèn)
管理
Powered by:
BlogJava
Copyright © wilesun
主站蜘蛛池模板:
阜康市
|
开原市
|
巧家县
|
怀远县
|
五原县
|
济宁市
|
勃利县
|
神农架林区
|
宜城市
|
惠东县
|
北流市
|
定结县
|
城市
|
仙居县
|
利辛县
|
绥滨县
|
平阳县
|
长葛市
|
扬州市
|
双城市
|
平遥县
|
隆德县
|
陆川县
|
调兵山市
|
五寨县
|
江永县
|
买车
|
韩城市
|
新巴尔虎右旗
|
正镶白旗
|
海晏县
|
章丘市
|
蒲城县
|
南皮县
|
青州市
|
郯城县
|
泾川县
|
五莲县
|
涪陵区
|
新竹县
|
灵丘县
|