Instance (computer science)


In a computer system, any time a new context is created based on some model, it is said that the model has been instantiated. In practice, this instance usually has a data structure in common with other instances, but the values stored in the instances are separate. Changing the values in one instance will then not interfere with the values of some other instance. A computer instance can be software state or hardware which can run a block code, for example a CPU, GPU or a virtual machine.[citation needed]

Computer graphicsEdit

In computer graphics, a polygonal model can be instantiated in order to be drawn several times in different locations in a scene. This is a technique that can be used to improve the performance of rendering, since the work needed to display each instance overlaps.

Object-oriented programmingEdit

In object-oriented programming (OOP), an instance is a concrete occurrence of any object, existing usually during the runtime of a computer program. Formally, "instance" is synonymous with "object" as they are each a particular value (realization), and these may be called an instance object; "instance" emphasizes the distinct identity of the object. The creation of an instance is called instantiation.

An object may be varied in a number of ways. Each realized variation of that object is an instance of its class. That is, it is a member of a given class that has specified values rather than variables. In a non-programming context, you could think of "dog" as a type and your particular dog as an instance of that class.[1]

In class-based programming, objects are created as instances of classes by subroutines called constructors, and destroyed by destructors. An object is an instance of a class as it can access to all data types(primitive as well as non primitive), and methods etc, of a class. Therefore, objects may be called a class instances or class objects. Object instantiation is known as construction. Not all classes can be instantiated – abstract classes cannot be instantiated, while classes that can be instantiated are called concrete classes. In prototype-based programming, instantiation is instead done by copying (cloning) a prototype instance.[2]

Operating systemsEdit

In the context of POSIX-oriented operating systems, the term "(program) instance" typically refers to any executing process instantiated from that program (via system calls, e.g. fork() and exec()); that is, each executing process in the OS is an instance of some program which it has been instantiated from.[3]


  1. ^ "What is instance? – Definition from". Retrieved February 9, 2014.
  2. ^ Amir, Masroor. "OOP - Object Oriented Programming - Concepts | Languages | Benefits [2023]". The Geeks Bot | A Computer Science Site for geeks. Retrieved 2023-04-04.
  3. ^ Bach, Maurice J. (1986). The Design of the UNIX Operating System. Prentice Hall. pp. 10, 24. ISBN 0-13-201799-7. Archived from the original on 2010-03-15.