@@ -0,0 +1,670 @@
+package com.javarush.task.task06.task0603;%0A%0A/* %0A%D0%9F%D0%BE 50 000 %D0%BE%D0%B1%D1%8A%D0%B5%D0%BA%D1%82%D0%BE%D0%B2 Cat %D0%B8 Dog%0A*/%0A%0Apublic class Solution %7B%0A    public static void main(String%5B%5D args) %7B%0A%0A        Cat%5B%5D cats = new Cat%5B50000%5D;%0A        Dog%5B%5D dogs = new Dog%5B50000%5D;%0A%0A        for (int i = 0; i %3C 50000; i++) %7B%0A            cats%5Bi%5D = new Cat();%0A            dogs%5Bi%5D = new Dog();%0A        %7D%0A    %7D%0A%7D%0A%0Aclass Cat %7B%0A    @Override%0A    protected void finalize() throws Throwable %7B%0A        super.finalize();%0A        System.out.println(%22Cat was destroyed%22);%0A    %7D%0A%7D%0A%0Aclass Dog %7B%0A    @Override%0A    protected void finalize() throws Throwable %7B%0A        super.finalize();%0A        System.out.println(%22Dog was destroyed%22);%0A    %7D%0A%7D%0A

Complete task0603