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

Explain about object oriented programming and its features?

1069


Why constructor has no return type?

1132


How many bytes is a unicode character?

1062


What is a super method?

1022


What is final method?

1118


How do you clear a method in java?

1048


Why null value is used in string?

1094


Are the imports checked for validity at compile time? Will the code containing an import such as java.lang.abcd compile?

1142


What are the changes in java.io in java 8 ?

1080


Can we extend immutable class?

1038


What is a 16 bit word?

1072


Explain enumeration in java?

1048


Can private members of a base class are inheritable justify?

966


Is alive method in java?

1038


What is memory leak and how does java handle it?

1030