When is an object in the mean to garbage collection?
Answers were Sorted based on User's Feedback
Answer / chandrarekha
whenever the object goes out of scope or when it is no
longer being referenced, in such cases it can be a garbage
object. Garbage collection is implicitly invoked whenever
resources have to be allocated to the new objects that are
created and approach to detect a garbage object can be done
through reference-counting collectors,tracing
collectors,compacting collectors. The garbage collectors
can also be explicitly invoked by gc() supported by JVM
which is in the java.lang package
Is This Answer Correct ? | 1 Yes | 1 No |
Answer / sathya
When the object is no longer referenced, its eligible for
Garbage Collection
Is This Answer Correct ? | 0 Yes | 1 No |
What methods are used to get and set the text label displayed by a button object?
Why const and goto are reserved keyword in java?
What classes of exceptions, thrown by a throw statement?
How do you achieve polymorphism in java?
Explain the importance of finally over return statement?
what is daemon thread and which method is used to create the daemon thread? : Java thread
what is difference between perfom() & excute() ?
What is difference between static class and normal class?
explain the concept of inheritance with an example?
Can we have multiple catch block for a try block?
What is equlas() and hashcode() contract in java? Where does it used?
What are decalarations?