File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes garbage collection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "garbage collection" Watch "garbage collection" New topic
Author

garbage collection

Akhil Gupta
Greenhorn

Joined: Apr 22, 2001
Posts: 6
Are primitive datatypes also garbage collected or it is only objects, if no then do we free memory of primitives.
Bryan Timmins
Ranch Hand

Joined: Mar 26, 2001
Posts: 48
No, garbage collection is performed on objects. I think the JVM deals with primitives behind the scenes.


<a href="http://www.bryantimmins.com" target="_blank" rel="nofollow">Bryan Timmins</a> <br />SCJP2
Gurpreet Sachdeva
Ranch Hand

Joined: Feb 20, 2001
Posts: 90
Hello Akhil,
The JVM allocates the memory to primitives when the object of the class having those primitives is created and that memory is de-allocated when that object is garbage collected.
Regards
Gurpreet Sachdeva
For any type of information regarding JCP exam(including mock exams) visit at: http://www.go4java.20m.com

Regards<BR>Gurpreet Sachdeva<P>For Mock Exams, FAQ, Exam tips and some useful information about Bitshift operator, inner classes, garbage collection,etc please visit: <A HREF="http://www.go4java.lookscool.com" TARGET=_blank rel="nofollow">http://www.go4java.lookscool.com</A>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: garbage collection
 
Similar Threads
Locked Thread
Tech Word Game
WA #1.....word association
Default Package
What is the least sexy occupation?