79256473

Date: 2024-12-05 23:13:57
Score: 1.5
Natty:
Report link

This is expected behavior.

When a program terminates, all objects remaining in its memory are deleted (which means that their destructors will be called).

When I run the program, the print statement for Tennis ball 2345 has been deleted :( is executed after the print statement for Num balls after del ball a: 1. In other words, the destructor for ball b is called when the program terminates, after all the code has been executed.

Reasons:
  • Blacklisted phrase (1): :(
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Rusty