Why object is known as instance of a class. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 11

Why object is known as instance of a class.

28th Nov 2019, 8:28 AM
Subhransu🤘🏻🤘🏻
Subhransu🤘🏻🤘🏻 - avatar
14 Answers
+ 9
An object is an identifiable entity with some characters tics and behavior. A class is a blueprint representing a group of objects that share common properties and relationships While class is a blueprint, an object is an actual entity which is an instance of a class. For instance, let's consider a class CAR . A car class defines that a car has characteristics like colour, length, width, height, etc. A CAR class just describes how a car should be like; a CAR object makes it reality by actually creating an entity as per the description of CAR class. LAMBORGHINI IS A CLASS WHEREAS Lamborghini HURRICANE is an object.
28th Nov 2019, 11:49 AM
Reca Resu
Reca Resu - avatar
+ 6
icydani what is known as a word?
28th Nov 2019, 10:44 AM
Sonic
Sonic - avatar
+ 4
Object creation is also known as instantiation.
28th Nov 2019, 9:06 AM
Sonic
Sonic - avatar
+ 4
because objects have physical existence and it is a real world entity representing a class think of class as a political party and object as its candidate 😎
29th Nov 2019, 6:04 PM
Aditya
Aditya - avatar
+ 2
That's basically it's definition.
28th Nov 2019, 9:04 AM
Sonic
Sonic - avatar
+ 1
Because we create the object of class with new keyword.
28th Nov 2019, 8:36 AM
A͢J
A͢J - avatar
+ 1
Because object is a "concrete thing" created using specific class as its blueprint. The class describes the concept of the object.
28th Nov 2019, 8:46 AM
Alexoah YT
Alexoah YT - avatar
+ 1
An object is a representative of a class. A class is a collection of functions and variables. You can use an object to specify the class from which you are using a specific functions. There may me same named functions in different classes. So you can use the object to use the function of the specified class. That's why it is called instance of a class.
28th Nov 2019, 12:58 PM
Ahnaf
Ahnaf - avatar
0
Instance is something created at a particular instant. Your class is abstract whereas object is a concrete version of your class created at a particular instant. Also objects have values of their own irrespective of the class.
28th Nov 2019, 11:21 AM
Sohamkumar Chauhan
Sohamkumar Chauhan - avatar
0
Some programming languages (Java, C++, C#, etc) require that every objects belong to some class. In such languages, objects and instances are identical and are used interchangeably. But strictly speaking, it has a different meaning.
29th Nov 2019, 10:15 AM
Takashi MATSUDA
Takashi MATSUDA - avatar
0
obyekt biror qiymatni o'zida namoyon etadi, sinf esa bu qiymatni tayinlashda ishlatiladi.
29th Nov 2019, 2:59 PM
Ziyodulla
Ziyodulla - avatar
0
An object is a real-world entity which have State, behavior, and Identity. i.e. You are the object of class Student. Note:- An object is the example of a class that is going to represent it in the real world that's why it is called as the Instance(or example) of the class.
29th Nov 2019, 4:35 PM
Thé Ka|yan M!shrā
Thé Ka|yan M!shrā - avatar
0
30th Nov 2019, 4:42 AM
Daniel Cooper
Daniel Cooper - avatar
- 4
its know as a word
28th Nov 2019, 9:44 AM
icydani
icydani - avatar