why not override thread to make a runnable? : Java thread
No Answer is Posted For this Question
Be the First to Post Answer
what is recursion in java
Explain what is Marker interface?
What occurs when an object is constructed?
What is the purpose of the return statement?
What is bufferedreader in java?
How do I print a “?
What is the meaning of I ++ in java?
Explain the difference between throw and throws in java?
What is multithreading and its advantages?
Why does java does not support multiple inheritance? Explain
How many bytes is a character?
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?