+ 1
How to use destructor in java?
I knew destructor is represented with '~' but here I gets error so can anyone tell me how to use I and how to declare it ?
2 odpowiedzi
+ 1
java has not got it, there are other ways eg try(),
but you can still overriding Object.finalize() method - but it's deprecated
https://docs.oracle.com/en/java/javase/14/docs/api/java.base/java/lang/Object.html#finalize()
0
Thank you zemiak