So - I changed 50000 to 500000 (although i'm not sure I understand why that was recommended to be honest) but I'm still failing the last requirement :(
package com.codegym.task.task06.task0603;
/*
Cat and Dog objects: 50,000 each
*/
public class Solution {
public static void main(String[] args) {
for(int i = 1; i <= 5000000; i++ );
{
Cat cat = new Cat();
Dog dog = new Dog();
}
}
}
class Cat {
@Override
protected void finalize() throws Throwable {
super.finalize();
System.out.println("A Cat was destroyed");
}
}
class Dog {
@Override
protected void finalize() throws Throwable {
super.finalize();
System.out.println("A Dog was destroyed");
}
}