About Question com.enthuware.ets.scjp.v6.1.754 :

Help and support on OCA OCP Java Programmer Certification Questions
1Z0-808, 1Z0-809, 1Z0-815, 1Z0-816, 1Z0-817

Moderator: admin

Post Reply
normc
Posts: 5
Joined: Thu Apr 19, 2012 2:18 pm
Contact:

About Question com.enthuware.ets.scjp.v6.1.754 :

Post 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?

admin
Site Admin
Posts: 10388
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question com.enthuware.ets.scjp.v6.1.754 :

Post 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.

cosmindumy
Posts: 7
Joined: Sun Apr 13, 2014 4:04 pm
Contact:

Re: About Question com.enthuware.ets.scjp.v6.1.754 :

Post 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?

admin
Site Admin
Posts: 10388
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question com.enthuware.ets.scjp.v6.1.754 :

Post by admin »

What makes you think that it will get "nullnull-null" or "null-nullnull"?
-Paul.

Post Reply

Who is online

Users browsing this forum: No registered users and 9 guests