answersLogoWhite

0

A Java object is ready to be garbage collected if there are no active references to the object. Let us say you declare an object of type ArrayList inside a for loop and process it. That object is local to the for loop and once the loop is executed there are no open references to the array list. Hence after the method is executed this object would be eligible to be garbage collected. The JVM garbage collector would search for such unused/unreferenced objects and clear them.

User Avatar

Wiki User

16y ago

What else can I help you with?

Related Questions

What is the cause of garbage?

the cause of garbage is litter


why is this garbage?

cause it is garbage


How is garbage cause of air pollution?

Garbage pollution can cause emissions of methane, a powerful greenhouse gas.


How do you delete reference of an object in java?

You can't really delete a reference to an object. You can set the reference to null, which will eventually cause the garbage collector to free up the memory from that reference, but you cannot explicitly delete anything.


How is oil collected?

It is collected by drilling into the earth but that can cause earthquakes.


What are the causes of improper garbage disposal?

Improper garbage disposal can cause harmful effects on animal life. Improper garbage disposal can also cause air pollution and pollution of soil.


What is the cause of improper disposal and uncollected garbage?

In my area the cause is usually the garbage guys going on strike for one reason or another.


What are the causes of garbage in your locality?

There is only ONE cause of garbage - people who don't care.


What do burning garbage cause?

The act of burning garbage causes the release of toxins into the air. This makes it difficult for people to breathe and can cause physical harm.


Does Garbage Cause Pollution?

Yes, garbage can cause pollution when it is not disposed of properly. Improperly disposed garbage can release harmful chemicals and greenhouse gases into the environment, contaminating air, water, and soil. It is important to manage and dispose of garbage responsibly to reduce pollution.


How can affect ozone layer by burning garbage?

Burning garbage produces greenhouse gases. It can cause ozone depletion.


What problems are caused by garbage disposal?

The most severe problem with garbage is where to put it. There's a huge pile of garbage in the middle of the Pacific Ocean; New York piles it on barges; garbage dumps get compacted and built on (the Shoreline Amphitheater in Mountain View, California, is on a garbage dump and there are tubes in the ground to release the methane, a major cause of Global Warming). We can only recycle and compost so much garbage. Garbage attracts rats and other disease-carrying vermin. Garbage and littering can also cause animals to suffocate. The chemicals in the pollution cause chemicals to rise into the air causing air pollution.