Page 1 of 1
About Question com.enthuware.ets.scjp.v6.1.754 :
Posted: Wed Apr 25, 2012 9:49 am
by normc
Sorry for being such a pain in the arse with so many questions...really getting my 20 bucks worth ha ha.
Although sb is not shared among multiple threads, a Person instance could be shared, thus allowing concurrent calls in the toString() method. Wrong?
Re: About Question com.enthuware.ets.scjp.v6.1.754 :
Posted: Wed Apr 25, 2012 10:55 am
by admin
Concurrent calls to Person instance will not cause any trouble in the given code because there are no public setters for the fields and the fields are private.
HTH,
Paul.
Re: About Question com.enthuware.ets.scjp.v6.1.754 :
Posted: Wed Apr 16, 2014 5:35 pm
by cosmindumy
I see the same problem.
Didn't try in IDE but probably different threads will get "nullnull-null" or "null-nullnull". Is this correct for this question?
Re: About Question com.enthuware.ets.scjp.v6.1.754 :
Posted: Wed Apr 16, 2014 10:08 pm
by admin
What makes you think that it will get "nullnull-null" or "null-nullnull"?
-Paul.