What is a difference between object and instance | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What is a difference between object and instance

i have a question object created by classes and object is like instanc of class then what is a difference between object and instant the question was asked to one of my friend in interview. any buddy have any Idea

1st Dec 2016, 7:31 PM
Khusrao Adil Khan
2 Answers
+ 2
An object is a thing, whereas an instance is a version of that thing currently in the game. Forr example, say you create an object like an enemy, and then have 10 of that enemy on screen. The enemy is the object, whereas each individual enemy actually in the game is a separate instance of that object. Hope that helped!
8th Dec 2016, 9:54 AM
Stien Distel
Stien Distel - avatar
- 4
An instance is an object that resides inside the memory. You can get more explaination using Google searching engine. Happy coding!
1st Dec 2016, 10:13 PM
Yasser Kaddoura
Yasser Kaddoura - avatar