In computer science, the object lifetime (or life cycle) of an object in object-oriented programming is the time between an object's creation (also known as instantiation or construction) till the object is no longer used, and is destructed or freed.
In object-oriented programming (OOP), the meaning of creating objects is far more subtle than simple allocating of spaces for variables. First, this is because, in the OOP paradigm, the lifetime of each object tends to vary more widely than in the case in conventional programming. There are many subtle questions, including whether the object be considered alive in the process of creation, and concerning the order of calling initializing code. In some sense, the creation can happen before the beginning of the program when objects are placed in a global scope.
Read more about Object Lifetime: Creating Objects, Destroying Objects
Famous quotes containing the words object and/or lifetime:
“I often used to think myself in the case of the fox-hunter, who, when he had toiled and sweated all day in the chase as if some unheard-of blessing was to crown his success, finds at last all he has got by his labor is a stinking nauseous animal. But my condition was yet worse than his; for he leaves the loathsome wretch to be torn by his hounds, whilst I was obliged to fondle mine, and meanly pretend him to be the object of my love.”
—Sarah Fielding (17101768)
“The individual, the great artist when he comes, uses everything that has been discovered or known about his art up to that point, being able to accept or reject in a time so short it seems that the knowledge was born with him, rather than that he takes instantly what it takes the ordinary man a lifetime to know, and then the great artist goes beyond what has been done or known and makes something of his own.”
—Ernest Hemingway (18991961)