That's a pretty terrible example. No way do you want temporary directories to be created just by loading a class. That violates all sorts of best practices.
There's a better example here: https://v8.dev/features/class-static-initializer-blocks
You could also use it for initialising generated constants.