0

Difference between class and object?

1st Jul 2017, 9:16 PM
Githesh
Githesh - avatar
6 Réponses
+ 11
A class is what defines an object - what data it has (fields and properties) and what it can do (behaviors). It's like a data type that you make yourself. And an object is an instance of a class, that can store the data you specified and do the things you defined. Like how you can make variables of built-in types like int or char, objects are like variables of a class.
1st Jul 2017, 9:33 PM
Tamra
Tamra - avatar
+ 3
class is a specification for how things should be. object is a thing that follows the specs laid out by it's class. does it answer your question?
1st Jul 2017, 9:20 PM
Venkatesh Pitta
Venkatesh Pitta - avatar
+ 3
If Human is a class, you are an object. Simple like that.
1st Jul 2017, 10:41 PM
Denis Felipe
Denis Felipe - avatar
+ 3
I hope this helps Class ~ a Human General Obj ~ Githesh, Manual, Tamra. Identity
1st Jul 2017, 10:43 PM
Manual
Manual - avatar
+ 3
One class ~ Anime Many objects ~ Naruto Uzumaki, Son Goku, Monkey D. Luffy....
2nd Jul 2017, 12:03 AM
Calviղ
Calviղ - avatar
+ 1
class Super Hero obj Super man, The flash
2nd Jul 2017, 3:44 AM
Manual
Manual - avatar