Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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?

Answer Posted / maverickhari

Thanks Namita

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Does printwriter create a file?

953


What is the preferred size of a component in java programming?

993


Is boolean a wrapper class in java?

1046


what is difference between equals and ==?

1057


What is object-oriented paradigm?

1059


What is a conditional equation?

1037


Can an interface implement another interface?

1023


What are the different ways of creating thread?

1004


Difference between keyword and identifier.

1022


What is an class?

1032


List the interfaces which extends collection interface?

937


Can You Have Virtual Functions In Java?

1137


Is the milky way in a void?

960


What one should take care of, while serializing the object?

894


What is meant by 'bit masking' in java?

1179