Void safety
Void safety (also known as null safety) is a guarantee within an object-oriented programming language that no object references will have null or void values.
In object-oriented languages, access to objects is achieved through references (or, equivalently, pointers). A typical call is of the form:
x.f(a, ...)
where f denotes an operation and x denotes a reference to some object. At execution time, however, a reference can be void (or null). In such cases, the call above will be a void call, leading to a run-time exception, often resulting in abnormal termination of the program.
Void safety is a static (compile-time) guarantee that a void call will never arise.
This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.