java tutorial from Sun is always a good resource to consult
所在版块:求学狮城 发贴时间:2004-06-29 21:46

用户信息
复制本帖HTML代码
高亮: 今天贴 X 昨天贴 X 前天贴 X 
First q: t is an local variable, t.MyString is accessing a member variable of t via t. Thus it is nothing related to public/protected/private limitation.


Second q: static initialization blocks are used for initilize a class member.

Note declaration also do the initialization for class member/instance member:
byte,short,int,long -> 0
float, double, -> 0.0
bool -> false
char -> empty character
object -> null


If you really want to access the thing in static{}, put static statements before define class member.

Seems you are doing SCJP, if yest, better read Java tutorial carefully.
.
欢迎来到华新中文网,踊跃发帖是支持我们的最好方法!

最新推出专栏《倾听索罗斯》 欢迎大家前来捧场!

Yeah!
 相关帖子 我要回复↙ ↗回到正文
问几个java问题 bigfox   (946 bytes , 633reads )
ur mails...got a lot...how? 小蹦   (0 bytes , 233reads )
really? help me pass them to 阿修罗 bah 3x 3x bigfox   (0 bytes , 376reads )
只要不是来自PR/UOB, 就不是很急. bigfox   (69 bytes , 307reads )
java tutorial from Sun is always a good resource to consult 香陵居士   (591 bytes , 284reads )
What's SCJP? Flying   (58 bytes , 294reads )
not suit for u at all. bigfox   (86 bytes , 373reads )
That's it lo... there are always long staircases to climb... Flying   (0 bytes , 280reads )
Hoho, if you are good enough to get SCEA, can got for it directly. ;) 香陵居士   (0 bytes , 232reads )
Answers: Flying   (944 bytes , 297reads )
are u saying that bigfox   (150 bytes , 404reads )
Yes. Flying   (582 bytes , 271reads )