public class Solution {
public static void main(String[] args) {
// напишите тут ваш код
for(int a=1; a<50000; a++){
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");
}
}
package com.javarush.task.task06.task0603;
/*
По 50 000 объектов Cat и Dog
*/
public class Solution {
public static void main(String[] args) {
// напишите тут ваш код
for(int a=1; a<50000; a++){
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");
}
}