• 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

how many elements are eligible for garbage collection

 
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
can oca izo-803 exam ask question on how many objects are eligible for garbage collection??,..i have found 3 to 4 questions based on same but unable to decide...i know following points..

1>object is created when you assign a reference using new keyword

2>you can only decide when object is eligible for garbage collection

3> Ob b = new Ob(); b =null;
it is eligible for garbage collection.

i have referred questions like at line 7 and 14 how many object is eligible for garbage collection??..i am not getting expected output based on above points...

their are some question which creates object in class, and in main class create another object , i am unable to decide whether object collection starts form main and at end how many are eligible for garbage collection..

also i have learned that garbage collection also depends on scope of object...please can anyone help me to understand how to prepare yourself with such question and overcome tricky trap laid by oracle certification moderators..


 
Akshay Rawal
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Examine the following code and select the correct statements (choose
2 options):

a At least two objects are garbage collected on line 1.
b At least one object is garbage collected on line 1.
c No objects are garbage collected on line 1
d The number of objects that are garbage collected on line 1 is unknown.
e At least two objects are eligible for garbage collection on line 2....answer d and e
 
Akshay Rawal
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi..everyone..i am not getting any response related to this post..please can anyone clear my concept
 
author
Posts: 23951
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Akshay Rawal wrote:hi..everyone..i am not getting any response related to this post..please can anyone clear my concept



If you are not getting an answer, perhaps it is better to also elaborate or clarify the question...

https://coderanch.com/how-to/java/HowToAskQuestionsOnJavaRanch

Henry
 
Can you hear that? That's my theme music. I don't know where it comes from. Check under this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic