Mphasis Interview Question

Why is garbage collection necessary in C#?

Interview Answer

Anonymous

Jun 19, 2021

An object becomes available for garbage collection when it is marked as null, goes out of scope or is no longer referenced by any non-null objects within an application. In simple terms, a Java object becomes available for garbage collection when it is no longer in use by the application.