What is the benefit of singleton pattern?
No Answer is Posted For this Question
Be the First to Post Answer
Explain about map interface in java?
What is the use of accept () method in java?
Differentiate between overriding and overloading cases?
Is there any tag in htm to upload and download files?
how to use crystal reports in java
how to deploy apache tomcat server to weblogic server in java
what is the use of bean managed and container managed with example?
Describe the Big-O Notation.
Can we declare the static variables and methods in an abstract class?
If try block is successfully executed, Then Is Finally block executed?
What are the types of sockets 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?