Prepare
Practice
Interview
Aptitude
Reasoning
English
GD
Placement papers
HR
Current affairs
Engineering
MCA
MBA
Online test
Login
Online Practice Test
>
Java Part 2
Next »
____________ method of Java is invoked by JVM to reclaim the inaccessible memory location
Options
- reclaim()
- final()
- finalize()
- Both b and c
CORRECT ANSWER : finalize()
Discussion Board
finalize()
The java.lang.Object.finalize() is called by the garbage collector on an object when it is found out that there are no more references to the object present in the memory. A subclass of the class can override the finalize() method to dispose of system resources or to perform other cleanup.
finalize() is called before Garbage collector reclaim the Object, its last chance for any object to perform cleanup activity. In this case scenario the system resources are released that are taken by the program and the open connections are closed if any. So whenever a memory location which is inaccessible garbage collector is called to free up the memory and the resources being used by it.
Rohit Sharma 08-14-2014 07:56 PM
finalize method
finalize method is called by garbage collection thread just before collecting object, releases any system resources held like closing connection if open etc. It is called only once by GC thread.
Bunty 07-5-2013 04:28 AM
Next »
Write your comments
*
*
Email must be in the form someone@domain.com
*
*
Enter the code shown above:
Please enter the code shown above
(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)
Related Content
Java Beginner (11)
Java (39)
Java (40)
Java (22)
Java (30)
Java (25)
Java (20)
Java (20)
Core Java (20)
Core Java (10)
Core Java (72)
EJB (20)
JDBC (20)
Applet (20)
Struts (21)
Servlets (20)
Java Web Services (20)
Javascript (40)
J2EE (10)
jQuery (46)
Advertisement
▲