編程生活
::
首頁
::
新隨筆
::
聯系
::
聚合
::
管理
::
113 隨筆 :: 0 文章 :: 18 評論 :: 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)
給我留言
查看公開留言
查看私人留言
隨筆檔案
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)
搜索
積分與排名
積分 - 186701
排名 - 310
最新評論
1.?re: eclipse.ini內存設置
那4g內存怎么配置?
--將i占
2.?re: log4j的ConversionPattern參數的格式含義
@輔導費
呵呵
--eval
3.?re: log4j的ConversionPattern參數的格式含義
@Hacken
你猜。。
--輔導費
4.?re: eclipse.ini內存設置[未登錄]
using...
--blue
5.?re: log4j的ConversionPattern參數的格式含義[未登錄]
#1 定義了兩個輸出端
log4j.rootLogger = INFO, A1, A2,A3
此處怎么會是兩個輸出端呢???
--Hacken
java動態創建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
閱讀(1505)
評論(0)
編輯
收藏
新用戶注冊
刷新評論列表
只有注冊用戶
登錄
后才能發表評論。
網站導航:
博客園
IT新聞
Chat2DB
C++博客
博問
管理
Powered by:
BlogJava
Copyright © wilesun
主站蜘蛛池模板:
泗阳县
|
太原市
|
会昌县
|
嘉定区
|
施秉县
|
广南县
|
德钦县
|
迁西县
|
华容县
|
清苑县
|
神池县
|
吉隆县
|
乌拉特中旗
|
萨迦县
|
栖霞市
|
滨海县
|
永德县
|
扎赉特旗
|
华容县
|
恭城
|
嘉荫县
|
南溪县
|
沧源
|
西藏
|
班玛县
|
神池县
|
科尔
|
玉树县
|
固原市
|
岑溪市
|
柳江县
|
蒙阴县
|
临江市
|
论坛
|
双江
|
新建县
|
黄平县
|
青海省
|
柘荣县
|
潮州市
|
芷江
|