Tech moves fast! Stay ahead of the curve with Techopedia!
Join nearly 200,000 subscribers who receive actionable tech insights from Techopedia.
An instance is simply defined as a case or occurrence of anything. In computer technology, this could be an element, document type, or a document that conforms to a particular data type definition (DTD).
An object belonging to a particular class, such as in Java, may also be described as an instance. Instances of a class share the same set of attributes, but each instance may differ in terms of what is contained in those attributes.
For example, a school class includes the following attributes: school_Name, school_Location, no_Of_Students and school_Board. These attributes are local to the school class and apply to every instance of the class. Consider two instances of a school class. Let the first instance include the values Thames Valley School, London, 355, and St.Thomas Board, respectively for the previously mentioned attributes, while the second instance includes values Cambridge Public School, West Hampshire, 200, and Cambridge Board, respectively. The two instances are distinct from each other and exist independant of each other. However, the basic structure of the class stays the same.