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                      
info       Did you received any Funny E-Mails from your Friends and like to share with rest of our friends? Yeah!! you can post that stuff   HERE
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 ?    0 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 ?    0 Yes 0 No
Harish
 
 
 

 
 
 
Other Core Java Interview Questions
 
  Question Asked @ Answers
 
How to access a variable if it is declared as private?  2
Is there is any error if you have multiple main methods in the same class? Wipro6
What is a Java package and how is it used?  1
what are the differences between final,finally,finalize methods?  3
what is overloading and overriding with example? CMC1
What is Vector?Can you elaborate how Vector is Thread safe?  3
Is it compulsory to have atleast one abstract method in abstract class?  6
Is multiple inheritance allowed in Java? Why ?  5
os is developed in c no java is more secured then c na why dont the os developed is developed using java  1
transaction attributes ?  2
why the abstract class has default constructor?  1
What is Remote Interface ? CTS2
Difference between abstract class and Interfaces? Sai-Softech5
diff between abstract methods and interfaces with programing (code) example?  2
What method is used to compare two strings ?  3
What is static and a non-static inner class?  1
What are the steps to do connection pooling in weblogic? TCS1
What is the return type of readLine() when end of a file is reached?  1
if two references are having same hash codes,is that means those are refering to same object? CTS4
what is multithreading? Virtusa3
 
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