Core Java With OCJP/SCJP-Garbage Collection-Part-12

preview_player
Показать описание
DURGASOFT is INDIA's No.1 Software Training Center offers
online training on various technologies like JAVA, .NET ,
ANDROID,HADOOP,TESTING TOOLS , ADF, INFORMATICA, SAP...
courses from Hyderabad & Bangalore -India with Real Time Experts.
so that our Supporting Team will arrange Demo Sessions.
Ph:Call +91-8885252627,+91-7207212428,+91-7207212427,+91-8096969696.
Рекомендации по теме
Комментарии
Автор

you r a real teacher how give all thing but not expect any tgtype of return
\

sonum
Автор

one funny question for durga sir: - If JVM is taking care of destroying the object then what is the need of understanding and reading this topic? 😂😂😂😂

gokarnapandey
Автор

public class FinalizeDemo
{
static int count=0, w, e, r, t, y, u, i, o;
public static void main(String[] args) throws Exception{
for (int
{
FinalizeDemo f[]=new
FinalizeDemo g[]=new
f=null;
g=null;
// System.gc();
}
}
public void finalize()
{count++;
System.out.println("finalize method call "+count);

}
}
sir why thiis program doesnt run garbage collector

sonum
Автор

the finalize method that you wrote for test class is not thread safe thus the {count ++} won't give you the correct number of objects destroyed by GC, as GC i think is running parallel cleaning

damejelyas