Tuesday, 27 May 2014

Concepts of Object

Concept of Object is an important part in understanding object-oriented language.

What is an Object ?

 An object, in real world can be one of the following:
  • anything that is visible or tangible.
  • something that may be apprehended intellectually.
  • something towards which one can direct act or think.
If we study all the things meeting above criteria of being objects, we can say that each of these things has an unique identity, some definitive state or characteristic and some behaviour.
To make things simpler, lets uderstand this using  an example hmmmm, maybe a watermelon.
Okay so for those who don't know what  a watermelon is, it is usually a big, round, green-coloured fruit. Well its not green from inside.
So as mentioned above an object usually has some characteristics and some behaviour.
If we consider watermelon as an object then its characteristics will be - It is round, It is Big, It is green from outside, It is red from inside etc.
Lets talk about its behaviour-- can be used to make juices, tastes sweet and etc.

Similarly we can say that a chair is also an object. Its characteristics are: it has four legs, one back, may or may not have arms. Its behaviour is : it lets you sit on it.

 Object

An Object can be thought of as an entity having a specific identity, specific characteristics and specific behaviour.






0 comments:

Post a Comment