java tutorial from Sun is always a good resource to consult
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.
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!