Win a copy of Microservices Testing (Live Project) this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

Thread doubt

 
Ranch Hand
Posts: 383
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Assume that th is an instance holding a thread object. th.start() causes the thread to start running and eventually complete its execution.
The object referenced by th is not accessable any more and is garbage collected when the garbage collector runs.



TRUE
FALSE-answer

Why answer is false?
 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
simpeel.
This question has nothing to do with Threads.
It deals with GC. Just because Garbage collection does NOT gurantee any specific behavior, it neither gurantees it will wipe off Any eligible object.


Originally posted by dolly shah:
Assume that th is an instance holding a thread object. th.start() causes the thread to start running and eventually complete its execution.
The object referenced by th is not accessable any more and is garbage collected when the garbage collector runs.



TRUE
FALSE-answer

Why answer is false?

 
Ranch Hand
Posts: 274
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi dolly,

check here,
https://coderanch.com/t/264798/java-programmer-SCJP/certification/Thread

Gitesh
 
dolly shah
Ranch Hand
Posts: 383
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Gitesh.
 
reply
    Bookmark Topic Watch Topic
  • New Topic