• Post Reply Bookmark Topic Watch Topic
  • New Topic

Threads and string pool  RSS feed

 
Ranch Hand
Posts: 381
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From whizlabs

Output?
I thought the answer to be unpredictable as both the threads are syncornized on their own strint str,but the explanation in the mock says that since the str is a string so there will be only one sring object(in string pool) on which both of the threads will be syncronized.
 
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
AABB or BBAA
 
Sanjeev Singh
Ranch Hand
Posts: 381
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Barry,I understood the answer.I just want to know whether these types (String pool)of question can be asked in real exam?
 
Barry Gaunt
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bert Bates has often written that we should stay away from any mock exam questions involving string pooling. So I conclude that you will not find such questions on the real SCJP examination.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!