Geeks Talk

Prepare for your Next Interview


Welcome to the Geeks Talk forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

can we call Finalize() ?

This is a discussion on can we call Finalize() ? within the Java forums, part of the Software Development category; can we call finalize()?...

Go Back   Geeks Talk > Software Development > Java
Register Blogs FAQ Tag Cloud Calendar Mark Forums Read

Java Java related Issues and Problems

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-22-2008
Junior Member
 
Join Date: Feb 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
atnbhushan is on a distinguished road
can we call Finalize() ?

can we call finalize()?
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 12-14-2009
Contributing Member
 
Join Date: Dec 2009
Location: chennai
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
mani_miit is on a distinguished road
Re: can we call Finalize() ?

yes,we can and also you can use System.gc(); method
Reply With Quote
  #3 (permalink)  
Old 12-26-2009
Junior Member
 
Join Date: Feb 2009
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
smartcasanova is on a distinguished road
Re: can we call Finalize() ?

ofcourse we can call finalize method, and System.gc() is also made for requesting the garbage collection...although System.gc() do not guarantee the garbage coolection.
Reply With Quote
  #4 (permalink)  
Old 4 Weeks Ago
Junior Member
 
Join Date: Feb 2010
Location: Bangalore
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
sanu_sasidharan is on a distinguished road
Re: can we call Finalize() ?

yes we can call the garbage collection methods, but there is no guarantee that objected marked for garbage collection will be infact garbage collected.

Ideally we should not do call or write logic based on garbage collection. It is the duty of the JVM to call this method.
Reply With Quote
  #5 (permalink)  
Old 4 Weeks Ago
Expert Member
 
Join Date: May 2009
Location: Bangalore
Posts: 1,187
Thanks: 155
Thanked 468 Times in 227 Posts
rijus is a glorious beacon of lightrijus is a glorious beacon of lightrijus is a glorious beacon of lightrijus is a glorious beacon of lightrijus is a glorious beacon of light
Re: can we call Finalize() ?

Quote:
Originally Posted by atnbhushan View Post
can we call finalize()?
Hi Friend,

Yes. Nobody will stop us to call any method , if it is accessible in our class. But a garbage collector cannot call an object's finalize method if that object is reachable.

Regards,
Rijus.
__________________
Real Inspirational Journey............Unanimously & Sincerely.
Reply With Quote
  #6 (permalink)  
Old 4 Weeks Ago
Junior Member
 
Join Date: Jan 2010
Location: Switzerland
Posts: 22
Thanks: 1
Thanked 0 Times in 0 Posts
OpenID is on a distinguished road
Re: can we call Finalize() ?

Yes you can call finalize(), but why you want to do something like this?

Share the problem statement, we might provide you a solution... if you may allow us.
Reply With Quote
Reply

  Geeks Talk > Software Development > Java

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
Call by Value and Call by Reference Lokesh M C and C++ 2 06-23-2009 02:29 AM
dispose,finalize venkat.rbs VB.NET 3 02-13-2008 10:33 AM
C++, Call another C++ program youarehappy41 MainFrame 0 09-25-2007 09:31 AM
Need more information on finalize method. TigerElango Java 2 08-16-2007 08:06 AM
How can i call that function? JobHelper Java 1 12-06-2006 02:16 AM


All times are GMT -4. The time now is 01:26 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.1
Copyright © 2005 - 2010 GeekInterview.com. All Rights Reserved