Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

a question about GC

 
michael wang
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please choose all correct description about Garbage Collection:
A. You can directly free the memory allocated by an object.
B. You can directly run the garbage collector whenever you want to.
C. The garbage collector informs your object when it is about to be garbage collected.
D. The garbage collector reclaims your object's memory as soon as it becomes a candidate for garbage collection.
E. The garbage collector runs in low-memory situations.
is the answer E
thanks a lot
 
mark stone
Ranch Hand
Posts: 417
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A. You can directly free the memory allocated by an object. FALSE
B. You can directly run the garbage collector whenever you want to. FALSE
C. The garbage collector informs your object when it is about to be garbage collected. this is TRUE as finalize() method is called before actually destroying an object.
D. The garbage collector reclaims your object's memory as soon as it becomes a candidate for garbage collection. FALSE as we don't know when it would actually run after an object becomes eligible for GC.
E. The garbage collector runs in low-memory situations. Not necesssarily, so FALSE

Originally posted by wangjiaxin:
Please choose all correct description about Garbage Collection:
A. You can directly free the memory allocated by an object.
B. You can directly run the garbage collector whenever you want to.
C. The garbage collector informs your object when it is about to be garbage collected.
D. The garbage collector reclaims your object's memory as soon as it becomes a candidate for garbage collection.
E. The garbage collector runs in low-memory situations.
is the answer E
thanks a lot

[ February 06, 2002: Message edited by: mark stone ]
 
Valentin Crettaz
Gold Digger
Sheriff
Posts: 7610
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
wangjiaxin,
Welcome to Javaranch "a friendly place for Java greenhorns"
This topic has been heavily discussed, you can use our search engine and search for the keywords "garbage collection" or whatever makes sense and you'll get plenty of answers to that question.
Moreover, we'd like you to read the Javaranch Naming Policy and register again.
Thank you for your cooperation.
 
michael wang
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Valentin Crettaz:
wangjiaxin,
Welcome to Javaranch "a friendly place for Java greenhorns"
This topic has been heavily discussed, you can use our search engine and search for the keywords "garbage collection" or whatever makes sense and you'll get plenty of answers to that question.
Moreover, we'd like you to read the Javaranch Naming Policy and register again.
Thank you for your cooperation.

thanks for Valentin Crettaz
i have made it as michael wang
is it ok now?
 
Valentin Crettaz
Gold Digger
Sheriff
Posts: 7610
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sure Michael that's perfect
 
Brian Lugo
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I always thought that GC runs in a low memory situation. Can annyone point to authentic resource(s) where it explicitly says "GC may not necessarily run in a low memory situation".
Thanks,
Brian
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic