How to write a class destructor in Scala?

Viewed 17515

I'd like to have a FileWriter opened during the whole time a class instance exists. So I need to close it in a destructor. But how to specify a destructor in Scala?

4 Answers
Related