"Szia Amigo. Még egy pár feladat neked:"

2
Feladat
Java Syntax,  szintlecke
Zárt
Cat's finalize method
It's difficult to accidentally lose an object: as long as you have even one reference to an object, it remains alive. But if not, then the object is approached by the finalize method, an unpredictable assassin that works for the Java machine. Let's create this method ourselves: protected void finalize() throws Throwable. The last two words will become clear a little later.
2
Feladat
Java Syntax,  szintlecke
Zárt
Zombie cats, zombie dogs
The Grim Reaper has come to CodeGym. In the previous level, we often "constructed" cats and dogs (using the constructors of the Cat and Dog classes) and created new instances of cats and dogs (objects). Now it's time to destroy objects that no one is referencing. In the Cat and Dog classes, write a finalize method, which displays text about the destruction of objects.