[hotjoe.com] HotJoe Java Help Forums
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Visit java.com
Missing post? - see this post about spam for more information.
Exact usage of System.gc  XML
Forum Index » Java Programming
Author Message
santo

Newbie

Joined: 10/03/2005 02:39:53
Messages: 4
Offline

hi i am new to java prgm.i had used system.gc in my prgm to destroy obj.
but after using system.gc

like..

system.gc();
obj.getsome();
this will call the method getsome

and

obj=null;
obj.getsome();
won't work

how exactly i have to use system.gc
stdunbar

Newbie
[Avatar]

Joined: 06/22/2005 14:51:37
Messages: 884
Location: Superior, CO, USA
Offline

Traditionally you never need to call System.gc(). In general it is a hint to the JVM, and is not guaranteed to actually do anything.

In your second call, you'll get a NullPointerException as the Object obj is now null.

What are you trying to solve? A little more information would be helpful.

Thanks for using the forums at hotjoe.com
[WWW] [Yahoo!] [ICQ]
 
Forum Index » Java Programming
Go to:   
Powered by JForum 2.1.9 © JForum Team
This site run by Scott Dunbar of Xigole Systems. © 2005-2012 - Scott Dunbar
Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners
hotjoe.com, xigole.com, and Scott Dunbar have no affiliation with Oracle