![]() |
| 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 |
![]() Related Questions The Collections API is a set of classes and interfaces that support operations oncollections of objects. Latest Answer : Collection API's are a group of classes where we can store more then one objects in as a single unit. Collection give some useful API where we can directly implement the Data structures. ... The List interface provides support for ordered collections of objects. Latest Answer : The list interface extends Collection and declares the behaviour of a collection that stores a sequence of elements. Elements can be inserted or accessed by their position in the list, using a Zero-based index. Alist may contain duplicate elements. ... Garbage collection does not guarantee that a program will not run out of memory. It ispossible for programs to use up memory resources faster than they are garbage collected.It is also possible for programs Latest Answer : The object is eligible for garbage collection only if there is no strong reference to the object. An exception to this is island of references(where all objects point to each other).And you should never write your significant code in the object's finalise ... 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 ... The purpose of finalization is to give an unreachable object the opportunity to performany cleanup processing before the object is garbage collected. Latest Answer : Java provides a method called finalize( ) that you can define for your class. Here’s how it’s supposed to work. When the garbage collector is ready to release the storage used for your object, it will first call finalize( ), and only on the next garbage-collection ... An object's finalize() method may only be invoked once by the garbage collector. Latest Answer : What if in the finalize method I make the object reachable.class a{ b b1=null; ..}class b{ a a1=null; ... A reachable object cannot be garbage collected. Only unreachable objects may begarbage collected.. Latest Answer : No. An object cannot be garbage collected when it is reachable. ... The garbage collector invokes an object's finalize() method when it detects that the objecthas become unreachable. Once an object is garbage collected, it ceases to exist. It can no longer become reachableagain. The purpose of garbage collection is to identify and discard objects that are no longerneeded by a program so that their resources may be reclaimed and reused.
Sponsored Links
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||