What do you understand by a Static Variable?
No Answer is Posted For this Question
Be the First to Post Answer
what is the diffrence between class and object?
What is HashTable?
What is the use of a conditional inclusion statement in Java ?
Is arraylist an object in java?
Can try statements be nested?
What is the purpose of a statement block?
What are white spaces in java?
What is the difference between @before and @beforeclass annotation?
Can a Byte object be cast to a double value?
Difference between a MenuItem and a CheckboxMenuItem?
Can we create constructor in abstract class ?
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?