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?
About Question com.enthuware.ets.scjp.v6.1.754 :
Moderator: admin
-
- Posts: 5
- Joined: Thu Apr 19, 2012 2:18 pm
- Contact:
-
- Site Admin
- Posts: 10388
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question com.enthuware.ets.scjp.v6.1.754 :
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.
HTH,
Paul.
-
- Posts: 7
- Joined: Sun Apr 13, 2014 4:04 pm
- Contact:
Re: About Question com.enthuware.ets.scjp.v6.1.754 :
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?
Didn't try in IDE but probably different threads will get "nullnull-null" or "null-nullnull". Is this correct for this question?
-
- Site Admin
- Posts: 10388
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question com.enthuware.ets.scjp.v6.1.754 :
What makes you think that it will get "nullnull-null" or "null-nullnull"?
-Paul.
-Paul.
Who is online
Users browsing this forum: No registered users and 19 guests