GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Tech FAQs  >  Programming  >  Java
Go To First  |  Previous Question  |  Next Question 
 Java  |  Question 18 of 928    Print  
Why do we need a finalze() method when Garbage Collection is there

  
Total Answers and Comments: 2 Last Update: April 30, 2008   
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
August 08, 2005 06:16:58   #1  
Kandukuri Ravinder        

RE: Why do we need a finalze() method when Garbage Collection is there
finalize() method is used to release the resources which were previously allocated for that object before the object is going to be Garbage Collected
 
Is this answer useful? Yes | No
April 30, 2008 13:43:40   #2  
meenama Member Since: April 2008   Contribution: 5    

RE: Why do we need a finalze() method when Garbage Collection is there

We need not call the finalize() method directly. The method is called automatically by the garbage collector when it determines no more references to the object exist. But when we need to clean-up non-Java resources ie closing a file we need to over-ride this method from java.lang.Object in our class implementation.


 
Is this answer useful? Yes | No

 Related Questions

Latest Answer : No it won't work.Only one main methods is allowed ...

Latest Answer : We need not call the finalize() method directly. The method is called automatically by the garbage collector when it determines no more references to the object exist. But when we need to clean-up non-Java resources ie closing a file, we need ...

Latest Answer : Finally method is executed whether the exception is raised or not and normally used to close the resource that are opened in the before. ...

Latest Answer : Its a common mistake to assume that overloading is a kind of polymorphism in OOPS..But its actually not..However the definition is the same.. an entity existing in different forms is called polymorphism..in Java, polymorphism is achieved with super class ...
Tags : OOPS

Latest Answer : Method Overriding means methods having the same method name,same number of arguements or same type of arguements.Here we use super() method to pass the arguements to the methods in the baseclass. ...
Tags : OOPS

Latest Answer :      method represents the behaviour of an object ...

Latest Answer : Please Check with this example programpublic class StaticExam { static int a=10;public static void main(String args[]){System.out.println(" Welcome to static variable testing");StaticExam s= new StaticExam();s.display();}public void display(){System.out.println(" ...

Latest Answer : the object that has no reference is assumed to no longer used. so to reclaim its memory garbage collection is used. ...

Latest Answer : overloading is a method ,class having same names but different datatypes in the parameter ...

Latest Answer : There is difference between overloading and overriding. In overriding you can add additional parameter to the function of the base class which does not affect the base class.The respective class(base or derived)will be called depending upon ...


 Sponsored Links

 
Related Articles

Service Oriented Java Business Integration Review

Service Oriented Java Business Integration Review Introduction If you ve read through the texts which give you an introduction to SOA or Web Services you will often find them to be quite frustrating and the reason for this is because they spend too much time referencing business processes which are
 

Concepts of Object-Oriented Programming

Object Oriented JavaScript In this chapter you ll learn about OOP Object Oriented Programming and how it relates to JavaScript As an ASP NET developer you probably have some experience working with objects and you may even be familiar with concepts such as inheritance However unless you re already a
 

Java and Client Server Models

Java and Client Server Models The Role of Client Servers on the Web Client server models provide the essential mechanisms for working with the Internet In fact most of the World Wide Web is built according to this paradigm In client server models the web browsers run by millions of users are the cli
 

What is Common Data Modeling Method

Common Data Modeling is one of the core considerations when setting up a business data warehouse. Any serious company wanting to have a data warehouse will have to be first serious about data models. Building a data model takes time and it is not unusual for companies to spend two to five years just
 

What is Data Collection

A database can be vast shared collection composed of data which are logically related to each other. Businesses rely heavily on data as they are Databases are used for managing the business day to day tasks so Data Collection happens every single day. Collection of data may seem a simple and trivial
 

What is Data Collection Time

Modern Relational Database Management Systems can be configured to collect data at certain events.  In a business, some of the events are sale, order, deposit, pay, request and many more. Events are really business activities in a company.  Big companies, in order to gain competiti
 

What is Data Collection Frequency

Data Collection Frequency, just as the name suggests refers to the time frequency at which data is collected at regular intervals. This often refers to whatever time of the day or the year in any given length of period. In a data warehouse, the relational database management systems continually ga
 

SQL Programming

SQL Programming Overview Anybody who has done something for a long time has probably wanted to change how things work at some point or another. A worker at a mill might have found a more efficient way of cutting logs, or a mathematics teacher might have had a hand in changing a school’s al
 

WinRunner Programming Concepts

If you want to create WinRunner scripts that are highly efficient, there are important programming concepts that you will want to become familiar with. Understanding these concepts will provide you with a large number of key benefits. In addition to understanding these concepts, you must also learn
 

Programming Languages Certification

IT Certification programs have several options that will offer you the best knowledge.  By learning everything that you need to know about information technology you will be able to open new doors to your career and personal business desires.  IT Certification offers several vari
 

About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape