ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
Do you have a collection of Interview Questions and interested to share with us!!
Please send that collection to along with your userid / name. ThanQ
Google
 
Categories  >>  Software  >>  Core Java  >>  Java J2EE  >>  Java Related
 
 


 

 
 Core Java interview questions  Core Java Interview Questions
 Advanced Java interview questions  Advanced Java Interview Questions
 Swing interview questions  Swing Interview Questions
 EJB interview questions  EJB Interview Questions
 Servlets interview questions  Servlets Interview Questions
 Struts interview questions  Struts Interview Questions
 JDBC interview questions  JDBC Interview Questions
 JMS interview questions  JMS Interview Questions
 SunOne interview questions  SunOne Interview Questions
 J2EE interview questions  J2EE Interview Questions
 Weblogic interview questions  Weblogic Interview Questions
 Websphere interview questions  Websphere Interview Questions
 Java Networking interview questions  Java Networking Interview Questions
 Java J2EE AllOther interview questions  Java J2EE AllOther Interview Questions
Question
how exactly garbage collection take place?
 Question Submitted By :: Vinayakkatkar
I also faced this Question!!     Rank Answer Posted By  
 
  Re: how exactly garbage collection take place?
Answer
# 1
Garbage Collection is an automated process in Java unlike C 
and C++. It executes to wipe out those objects which no 
longer are used in a program or stay idle for a very long 
time. This to free memory space alloted to these 
objects.However, it is not guaranteed that all the idle 
objects wil be destroyed every time garbage collection 
process gets executed.A user can also manually call the 
garbage collection to take place by executing System.gc() 
method.
 
Is This Answer Correct ?    0 Yes 0 No
Niraj Talukdar
 
  Re: how exactly garbage collection take place?
Answer
# 2
Another way to call garbage collector :-
Runtime rt = Runtime.getRuntime();
rt.gc();
 
Is This Answer Correct ?    0 Yes 0 No
Vinay
 
 
 
  Re: how exactly garbage collection take place?
Answer
# 3
Variable/object 
1. is eligible for garbage collection when no object refers
to it. 
2. Is eligible when its reference is set to null  i.e
objName=null.
3. referred by method variables or local variables are
eligible for garbage collection  when they go out of scope.
 
Is This Answer Correct ?    0 Yes 0 No
Vijayakumar Chinnasamy
 
  Re: how exactly garbage collection take place?
Answer
# 4
As in Java its happen automatically, but if you want to do 
this force fully you can do this by the use of 
keyword "finalize".
 
Is This Answer Correct ?    0 Yes 2 No
Devil
 

 
 
 
Other Core Java Interview Questions
 
  Question Asked @ Answers
 
how to handled exceptions & erros in ejb? Satyam1
What are command line arguments?  3
what is stringtolennizer with example? Symphony1
Linked List reverese program Bally-Technologies1
why ,we are using jsp and html.which one is better? Photon1
How to access a variable if it is declared as private?  2
which methods consisting of the serilizable interface?  3
static inner classes means..?  1
What is the default modifier in Interface?  4
how can you retrive information from database by using hashmap/arraylist ,plz explain with example briefly? Satyam1
how can we use the servlet as standalone apllication?should we need to extend any class? Logica-CMG2
why interfaces are faster than abstract classes?  2
what is an anonymous class? TCS5
what is sendredirect? TCS3
What are the parameters used in Connection pooling? IBM1
What is advantage of using threads? BMC2
wahts is mean by thread? HCL14
Features of Java?  4
what is polymorphism? Zensar5
What is casting?  3
 
For more Core Java Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com