basic java question# Java - 爪哇娇娃
w*t
1 楼
questions are:
if a java class has static block
static {
... (line 1)
...
... (line n)
}
I understand it's only executed only once when this class loaded first time.
what if 2 thread try to load this class at the same time, race condition
happens?
thanks,
if a java class has static block
static {
... (line 1)
...
... (line n)
}
I understand it's only executed only once when this class loaded first time.
what if 2 thread try to load this class at the same time, race condition
happens?
thanks,