Persistence
"Persistence" is another word for the life span of a piece of data. Persistence takes several forms. Some variables persist
for the life of a particular block of code or routine. Variables declared inside a for loop in C++ or Java are examples of this kind of persistence.
as long as you allow them to. In Java, variables created with new persist until they are garbage collected. In C++, variables created with new persist until you delete them.
for the life of a program. Global variables in most languages fit this description, as do static variables in C++ and Java.
forever. These variables might include values that you store in a database between executions of a program. For example, if you have an interactive program in which users can ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access