Cat and Dog objects: 50,000 each

  • 4
  • Locked
  • Exercise
If you have not yet been touched by the beauty of loops in programming, try finishing this task without them. Of course, this task isn't so much about loops as it is about the destruction of unused objects. Anyway, create 50,000 each of Cat and Dog objects in a loop. Doing this will force the Java machine to call the finalize method at least a few times.
You can't complete this task, because you're not signed in.
Comments(4)
  • Popular
  • New
  • Old
You must be signed in to leave a comment
Chanda B BarrickLevel 7 , Seattle
15 August, 01:01
I didn't actually get any output showing the finalize method was called for 50,000, but incrementing to 500,000 did trigger the finalize method.
Laurence Chadwell Level 7 , San Antonio
22 September, 23:33
do(i < 50000)... not (i <=50000)
OreganoLevel 8
24 September, 06:03
Thank you for this comment. The task is a bit confusing...
VenkatLevel 6 , Bangalore
4 July, 10:02
What wrong I have done here?