GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

GeekInterview.com  >  Interview Questions  >  J2EE  >  Java
Go To First  |  Previous Question  |  Next Question 
 Java  |  Question 870 of 923    Print  
Why finalize method in object class is protected ?

  
Total Answers and Comments: 2 Last Update: March 24, 2008     Asked by: uma 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
March 24, 2008 07:02:42   #1  
ravi_1229 Member Since: November 2006   Contribution: 7    

RE: Why finalize method in object class is protected ?
every user defined class extends object class in java . so  if the user defined class having some resources to deallocate(such as database connection, file closing, streams closing) the finalize method is overriden in the current class. thats y the finalize method in object class is protected.
 
Is this answer useful? Yes | No
March 24, 2008 07:11:31   #2  
vimalraj Member Since: February 2008   Contribution: 1    

RE: Why finalize method in object class is protected ?

The fact that class Object declares a finalize method means that the finalize method for any class can always invoke the finalize method for its superclass. This should always be done, unless it is the programmer's intent to nullify the actions of the finalizer in the superclass. (Unlike constructors, finalizers do not automatically invoke the finalizer for the superclass; such an invocation must be coded explicitly.)


 
Is this answer useful? Yes | No

 Related Questions

Objects that subclass the Observable class maintain a list of observers. When anObservable object is updated it invokes the update() method of each of its observers tonotify the observers that it has changed 
Latest Answer : Observer observe only those class which are Observable. ...

With respect to multithreading, synchronization is the capability to control the access ofmultiple threads to shared resources. Without synchronization, it is possible for onethread to modify a shared 
Latest Answer : Synchronization is the mechanism that ensures that only one thread is accessed the resources at a time. In a practical point of view assume that two threads are trying to update bank balance at the same time!!! How we can solve this issue the answer is sychronization. ...

Yes, a lock can be acquired on a class. This lock is acquired on the class's Class object.. 
Latest Answer : As your might already know, any synchronisation needs an object (monitor) to acquire lock one. See below for the three different types on how to synchronise code.public class A{  // A monitor object of sycnhronising piece of code.   private ...

The setLayout() method is used to specify a container's layout. 

The Vector class provides the capability to implement a growable array of objects 
Latest Answer : A vector implements dynamic array, which can grow and shrink dynamically.It is similar to Arraylist with a difference that vector can be synchronized. it also contain some legacy methods. ...

A (non-local) inner class may be declared as public, protected, private, static, final, orabstract. 
Latest Answer : An inner class is a full pledged member of the enclosing class (outer class), so it can be marked with any access modifier including abstract or final modifiers(neer both abstract and final together). But an inner class cannot contain any static members ...

setBounds() 
Latest Answer : component.setBounds(-,-,-,-); ...

When a task invokes its yield() method, it returns to the ready state. When a task invokesits sleep() method, it returns to the waiting state. 
Latest Answer : yield method is mainly used to release the lock of resource and pull up in to steady state from wait pool. Sleep() will pull the thread to sleep for the given time. It will throws exception while trying to intrupt in b/w the sleep state ...

The EventObject class and the EventListener interface support event processing. 
Latest Answer : Java.util.Event class ...

An object's finalize() method cannot be invoked by the garbage collector while the objectis still reachable. However, an object's finalize() method may be invoked by otherobjects. 
Latest Answer : No, reachable obejcts can not be garbage collected ...


 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
 

ODP.NET - OracleCommand Object

ODP NET More About the OracleCommand Object Till now we have seen OracleCommand working with OracleDataReader OracleCommand is not simply meant for OracleDataReader It has got a lot of functionality for itself Let us see few of the most commonly used features of OracleCommand in this section We will
 

Microsoft AJAX Library - Creating Object Members on the Fly

Creating Object Members on the Fly One major difference between OOP in C and ASP NET and OOP in JavaScript is that JavaScript allows creating object members on the fly" This is true for objects and classes that you create yourself and also for JavaScript s own objects and types as well He
 

Microsoft AJAX Library - Object-Oriented JavaScript

Object Oriented JavaScript Objects and classes are implemented differently in JavaScript than in languages such as C VB NET Java or C However when it comes to using them you ll feel on familiar ground You create objects using the new operator and you call their methods or access their fields using t
 

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
 

C++ Pure Virtual Function and Base Class

C Pure Virtual Function and Virtual Base Class In this C tutorial you will learn about pure virtual function declaration of pure virtual function and virtual base class virtual base class and how to implement a virtual base class explained with examples mosgoogle center What is Pure Virtual Function
 

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
 

How to Access C++ Class Members

How to Access C Class Members In this C tutorial you will learn how to access Class members dot operator or class member access operator difference between struct and class and  scope resolution operator mosgoogle center It is possible to access the class members after a class is defined an
 

Object-Oriented Client-Server Internet

Object Oriented Client Server Internet OCSI Environments as IT Infrastructure Client Server Basics Object Oriented Client Server Internet OCSI environments provide the IT infrastructure for supporting OCSI applications For our purposes infrastructure refers to operating systems networks middleware
 

JavaScript String Object

JavaScript String Object In this JavaScript tutorial you will learn about String Object purpose of string object in JavaScript purpose of string object indexof method lastIndexOf method and substring method along with syntax and example mosgoogle center Purpose of String Object in JavaScript The mai
 





About Us  |   Privacy Policy  |   Terms and Conditions  |   Contact  |   Site Map  |   Add Question  |   Propose Category  |   RSS Feeds  |   Articles Sitemap  |   Site Updates  |   Add Resource

Copyright © 2005 - 2008 GeekInterview.com. All Rights Reserved
Page copy protected against web site content infringement by Copyscape