Java takes care of this calling the finalize method for object automatically and there is nothing you can do about that.
You can ask Java to run garbage collection, but the system is free to ignore your requests.
It's possible you have discovered a typo/error with the exam.
You may want to see if this has previously been reported on the support site for this found here
https://www.selikoff.net/
Side note:
The finalize method is on it's way to being deprecated and not used with the newer versions of Java.