Can array grow dynamically in java?
No Answer is Posted For this Question
Be the First to Post Answer
what is the reason behind non static method cannot be referenced from a static Context?
What is abstract class? Explain
Why is method overloading not possible by changing the return type in java?
Is java a digit method?
What is the difference between a factory and abstract factory pattern?
Explain Connection Pooling?
What is data member in java?
Difference between operator overloading and function overloading
0 Answers Tavant Technologies, Virtusa,
What is the platform?
Explain the concept of polymorphism with examples?
What are thread priorities and importance of thread priorities in java?
public class Garbage { int a=0; public void add() { int c=10+20; System.out.println(c); System.out.println(a); } public static void main(String args[]) { Garbage obj=new Garbage(); System.gc(); System.out.println("Garbage Collected"); obj.add(); } } Above is a code in java used for garbage collection. object obj has been created for the class Garbage and system.gc method is called. Then using that object add method is called.System.gc method if called the obj should be garbage collected?