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 is Garbage collection done in Java?
 Question Submitted By :: Guest
I also faced this Question!!     Rank Answer Posted By  
 
  Re: How is Garbage collection done in Java?
Answer
# 1
Garbage Collection is a complex feature in Java Technology.
By Programme we cannot cause gc but we can request JVM using
gc() method but it does not gurantee. Actually when an
object in our programme become unreachable it is ready to
garbage collection..the garbage collection runs periodically
and then claim the memory it does occupy ( the unreachable
object)..and is how garbage collected is done.
 
Is This Answer Correct ?    3 Yes 0 No
Sandeep
 
  Re: How is Garbage collection done in Java?
Answer
# 2
Garbage Collection is carried out based on the reference 
type an object is currently in.
There are 4 types of references in java
1)strong reference
2)soft reference
3)weak reference 
4)phantom reference

the last one is the weakest of the weak.
JVM will try get all those of object that are fell in this 
category and try to collect it.
But it is not neccessary the object in phantom reference 
phase will always be garbage collected.
 
Is This Answer Correct ?    2 Yes 0 No
Harish
 
 
 

 
 
 
Other Core Java Interview Questions
 
  Question Asked @ Answers
 
Are nested try statements are possible?  2
Explain Connection Pooling?  3
What do you mean by the term transient? Ericsson4
JSP is by default thread safe or not? what is the meaning of isThreadSafe="true" and isThreadSafe="false". Explain it? Thanks, Seenu Huawei3
why the equals method can be override?when we override the equals method?  4
how to handled exceptions & erros in ejb? Satyam1
what is the difference between @include page and @include file  2
What is a native method?  2
In the HashMap, we know the values but we dont know the key, then how can we get the key from HashMap ????? Kanbay3
Can you call a private data from an inner class?  3
Howmany number of objects we can store in an ArrayList. Is there any limit? TCS5
how to compile jsp? Logica-CMG3
transaction attributes ?  2
whats string ? HCL8
What are Transient and Volatile Modifiers?  1
what is the difference between a java object reference and c++ pointer?  3
what is web.xml?and its use? CTS6
What is meant by packages?  2
int a=1; float b=1.0; System.out.println(a==b); Honeywell8
Is ResultSet class? Bally-Technologies2
 
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