Difference between identity, attribute and behavior? Explain it with the help of any real object. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 6

Difference between identity, attribute and behavior? Explain it with the help of any real object.

19th Oct 2016, 3:21 PM
Jaya
3 Answers
+ 8
imagine a group of people.identity is the name and title like john or tom.attribute is what is the staff like and its details.for example john is young and dignified.behavior is what is its job and what does it works. for example john is a programmer and he codes.good luck!
19th Oct 2016, 8:07 PM
Ayin GhaziMoradi
0
object is like a tree! may have roots, branches, leaves, flower or fruits as it's sub objects or classes. it's seed is an attribute for it and growing as tree is it's behaviour ☺
3rd Nov 2016, 6:27 AM
Amit
0
Here class SomeClass{...}; This is an object of the SomeClass type SomeClass object; The object is intented to do smth useful: object.doSmth(); The object has its attribute. tAttribute attribute =object.getAttribute(); The set of attribute values is object current state.
20th Nov 2016, 12:43 AM
Alexander Pushkar
Alexander Pushkar - avatar