Objects and instances are used as almost similar concepts in object-oriented programming, but technically they are slightly different concepts.
The cause of object-oriented programming is the most similar to human thinking
It can be said that it is for programming.
In other words, everything in our real life is made up of objects.
In a broad sense, an object is something that can be seen and touched, understood, and means what a thought or action seeks.
In other words, an object can be a specific object or system that we recognize,
Rivers and fog, which are specific but physically ambiguous boundaries, can also be said to be objects.
Instance*
An instance is, for example, when we define a class that is a blueprint, we can create as many instances in this class that are distinct from each other.
If there is a class of people, there are instances of each individual of more than 5 billion people in the world.
In other words, an instance refers to an object created through the definition of a class.
class Test{
Person p1; // Person-type objects
p1 = Person(); // Instance }
*Object*
From an object-oriented programming point of view, an object means when it is declared as a type of class, and when the object is assigned to a memory and used in practice is called an instance.
In other words, an instance is an actual implementation of an abstract concept or a template such as a class object, a computer process, or the like.
Instantiation defines specific variations for objects in a class,
It means creating an instance by giving a name and then placing it in a physical place.
-Some authors say that instantiating a class in object-oriented programming is creating a specific instance of a class, i.e., an object.
The object is an executable file that can be executed within a computer.
-Object orientation
In Java, the programming language, many users confuse an object instantiated from a class by calling it a class instead of the word object.
In Java, you instantiate a class to create a particular class,
It is also an executable file that operates on the computer.
-In data modeling or programming prior to the concept of object-oriented programming, one example was creating a real (data-containing) object from an abstracted object by creating a new entry in a relational database table.
'C' 카테고리의 다른 글
- 연결리스트 - (0) | 2010.12.29 |
---|---|
- 동적배열 - malloc() (0) | 2010.10.21 |
- 함수 포인터 , void형 포인터 - (0) | 2010.10.20 |
- #pragma - (0) | 2010.10.20 |
- 비트 연산자 - (0) | 2010.10.18 |