aspose file tools*
The moose likes Beginning Java 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 » Java » Beginning Java
Bookmark "Garbage Collection" Watch "Garbage Collection" New topic
Author

Garbage Collection

Baskar Dilli
Greenhorn

Joined: Aug 05, 2007
Posts: 7
when the objects are declared with static modfier, will it be garbage collected? when there is no reference from active stack frame.


Baskar Dilli<br />scjp,scwcd,scbcd
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61218
    
  66

"baskar d", please check your private messages for an important administrative matter.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Peter Chase
Ranch Hand

Joined: Oct 30, 2001
Posts: 1970
Originally posted by baskar d:
when the objects are declared with static modfier, will it be garbage collected? when there is no reference from active stack frame.


Objects cannot be static or non-static. Object references are static or non-static.

An object will be garbage collected some time after the last reference to it has gone away. It doesn't matter whether those references are static or non-static.


Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

"Baskar D",
Please check your private messages.
-Ben


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Garbage Collection