Object-Oriented Programming, unit: Exception Handling and Memory Management. Core concepts, terminology, and worked-example cues a college student meets for this unit, building on prior units without repeating them. Front: a term, concept, or short problem cue. Back: the definition, explanation, or answer.
38 cards · basic cards · AI-written, checked twice. Edit anything.
- What is exception handling?
Show answer
A mechanism for responding to and managing runtime errors in a controlled way
- What is an exception?
Show answer
An object representing an error or unexpected event that disrupts normal program flow
- What does a 'try' block do?
Show answer
Contains code that might throw an exception during execution
- What does a 'catch' block do?
Show answer
Handles a specific type of exception thrown in the corresponding try block
- What does a 'finally' block do?
Show answer
Executes cleanup code regardless of whether an exception was thrown or caught
- What is throwing an exception?
Show answer
Signaling that an error has occurred by creating and raising an exception object
- What is a checked exception?
Show answer
An exception that must be explicitly caught or declared, enforced at compile time
- What is an unchecked exception?
Show answer
An exception not required to be caught or declared, typically representing programming errors
- What is exception propagation?
Show answer
An uncaught exception passing up through calling methods until it is handled or crashes the program
- What is a custom exception class used for?
Show answer
Representing application-specific error conditions with meaningful names and information
- What is memory management, in OOP languages?
Show answer
The process of allocating and freeing memory used by objects during a program's execution
- What is garbage collection?
Show answer
An automatic process that reclaims memory used by objects no longer referenced by a program
- What is a memory leak?
Show answer
Memory that is no longer needed but not released, gradually exhausting available resources
- What is manual memory management?
Show answer
A model where the programmer explicitly allocates and frees memory, as in C
- What is a reference count, in some garbage collection schemes?
Show answer
A tracked number of references to an object, used to determine when it can be freed