• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

GC

 
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
Which of the following statements about Java garbage collection is a true statement? [Check all correct answers]
A)The following code will start the garbage collection mechanism: System.gc(); Thread.yield();
B)Calling Runtime.getRuntime().gc() will probably start the garbage collection mechanism, but there is no guarantee.
C)The garbage collection Thread has a low priority.
D)The method by which Java determines that a chunk of memory is garbage is up to the implementer of the Java Virtual Machine.

IMHO Answer B&C are correct.But i am not sure with option D.In fact i dont understand this point.
Thanx,
Poonam.
 
Ranch Hand
Posts: 201
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
You are very correct with options B and C.
But I feel option D means, Garbage Collection is implementation specific ( i.e. it can vary for different platforms)
and I think, it shd be also CORRECT.
Correct me if I am wrong.
Thanx
 
Ranch Hand
Posts: 153
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Implementation of GC is JVM dependent & on that count D should be correct.
IMO, B,C,D are correct.
tvs sundaram
 
reply
    Bookmark Topic Watch Topic
  • New Topic