answersLogoWhite

0


Best Answer

when there is cleanup activity needed before an object is destroyed

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: When do you override the finalize method?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering
Related questions

Can you override an instance method and make it final?

No. Once a method is declared final in a class, no derivative of that class can override that method.


Can you override the life cycle methods of a JSP?

You cannot override the jspService() method but you can override the jspInit() and jspDestroy() methods


Why can't method override be used without inheritance?

Overriding a method means that you are replacing an existing or virtual method that has already been defined in the parent object class, so without using inheritance, there can be no existing method to override.


Any method in a super class can be overridden in its subclass?

False.Any method declared as final cannot be overridden by any subclasses.You also cannot technically override a private method. While your subclass can have a method with the same definition as a private method in the superclass, it does not actually override that method.


Why must you override the hashcode method while overriding the equals method?

Because, if two objects are supposed to be equal as per the equals() method, then the value returned by the hashCode() method must also be the same. This will not be the case if you override only the equals method and this can have some confusing effects when using those objects with hash related collections. So it is always a good idea to override the hashCode() method if you are providing an implementation for the equals method.


What do you use instead of a destructor in java?

Hi, This is suneetha. We use Finalize() method in java instead of destructors. Finalize() is used to release the memory before the garabage collection takes place.


Where can I find some information on the whereabouts of some forensic accounting courses?

Finalizes are methods that objects can use to release resources before they are destroyed. The garbage collection part of the virtual machine is responsible for calling finalizes. The actual finalize method is called finalize (). This method


What is finalize method in java?

Finalize method is used when a variable becomes unreachable or of no use. it is finalize and garbage collection will free the memory used by it, which can be then reclaimed for some other variable


What method do you override to initialize instance variables in a JSP declaration?

jsp init()


What is first call in struts2 default constructor or validate method?

Default Constructor will be called first . If you override Validate method , then validate method will be called .


What is the verb of final?

Finalize


Why do you think that the Florida constitution provides a method for the legislature to override a governors veto?

Rx