+ 1
Hi who can say all thing about finalize method
2 ответов
+ 1
@AMIR aghazadeh finalize method is called by the garbage collector however jvm uses this method only for finalizing ie closing the objects of non java function ie closing of files ..and the finalize is called only once and its important to use exceptions while using the finalize method ...the way of declaring the finalize is as
protected void finalize ()thows throwable
{try{
filename.close();
}
}