Xiaobo Sun

Eclipse-Unix http://umlfact.berlios.de/~s_xsun/

Java initialization

The JAVA field (which is located in the Object in the heap) is default initialized as 0, false, and null.

A a = new A(); // equal

A a; // a is pointer/ref in the stack. (In stack the integer value take the random value)
a = new A(); // new A() is the Object in the heap. (In heap the integer value will be initialized as 0)

posted on 2007-07-16 14:16 Xiaobo Sun 阅读(313) 评论(0)  编辑  收藏 所属分类: Java


只有注册用户登录后才能发表评论。


网站导航:
 
<2007年7月>
24252627282930
1234567
891011121314
15161718192021
22232425262728
2930311234

导航

统计

常用链接

留言簿(3)

随笔分类

随笔档案

搜索

最新评论

阅读排行榜

评论排行榜