instance of an object
What it means by create an instance of an object ? The words instance means in programming.. ?
In traditional (class based) OOP, there are classes and objects. Every object has a class, and an object is an instance of its class. Classes create objects and determine their behavior. All objects of the same class have the same behavior, that is they share the same set of methods (or functions).
Objects are instances. Instances of a class.
If you consider a class as being the blue print of a standard apartment in the block where I live, my apartment is an instance, my neighbor's apartment is another instance, ... They share the same project (the class), but they are different apartments (instances [objects] of that class). They have identical properties, but their properties have different values. My bathroom is painted in blue, while my neighbor's is white.
Last edited by Kor; 05-11-2012 at 03:01 AM.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)