Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What is garbage collection in Java, and how can it be used ?

Answer Posted / rahulmishra642

1>Garbage collection is a deamon thread which runs at the background to support the nin deamon thread.
2>garbage collector is responsible to destroy the useless objects.
3>An obejct is eligible for GC if and only if it doesn;t have any reference.
4>we can also call GC explicitly by System Class and Runtime class
By System Class:
- System.gc();
By Runtime Class
-Runtime r = Runtime.getRuntime(); (here we are creating runtime object by using factory method)
now, you can call gc() method
-r.gc();

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is Recursion Function?

1128


What is a byte string?

1051


What is covariant return type?

1057


Is there any limitation of using inheritance?

1025


What are the differences between heap and stack memory?

1020


What are structs in java?

1001


Where are variables stored?

918


Does the order of public and static declaration matter in main method?

1029


Explain about OOPS concepts and fundamentals.

997


What is annotation in java?

996


What is a stack class in java ?

1051


What is the purpose of default constructor?

956


Which arithmetic operations can result in the throwing of an arithmeticexception?

970


What is a void method java?

908


what is the swingutilities.invokelater(runnable) method for? : Java thread

991