Welcome To Shadab's Blog

Programming Blog to learn C# , java, Sql Server 2005 and many more things.





About Me

My photo
Bokaro, Jharkhand, India

Friday, January 22, 2010

What is an Object?

Now you have learnt what a class is in programming language.

Actually above definition was in general term.
But we can define it in programming language like:


CLASS- > Set of attribute (variable) or behavior (method) that is shared by all the object of a particular type is called class. It is a blue print for creating the object.

Now I’ll discuss the object.

What is an Object?

In Real life we see many things we can say all are object.
Like TV, computer, dog, ram (name of a boy), CPU, keyboard etc all are object.
I n programming language an object is an entity mean that has existence.

Whether it logical or physical.
Logical means we can’t touch it. Like XP operating system, Vista.
Physical means we can touch it. Like dog, cat, computer, TV etc.






In other words object is an instance of a class.


Suppose you are an object and your name is Ram.
Then Ram would be an object of human_beings class.


We can identify an object very easily.






Object has thee characteristics by which we can easily identify it.
1. State->set of attribute and their values is called state.
                      Suppose car is an object of a Automobile class.
                      Then every car has some state like
                       Speed=0, color=”red”, no_of_wheel=4 etc.


                      For example -> you are an object that means you have a state.
                      What is your set of attribute?


                     Your height, weight, no_of_hands, complexion etc.
                      And if put some value to your attribute that is called your state.






2. Identity->Identity is one of the most important characteristics of Object by which
                            we can easily   identify an object.
                            Suppose you are an object then what is identification marks?
                            Your finger print is identification marks.
                            Suppose a computer is an object then its model number is its identification marks.






3. Behavior-> in general term any task that is performed by an object is called Behavior. In programming language it is called method as well.
                                For example -> suppose you are an object what would be your behavior.
                                You can speak, you can walk, you can talk, you can write.
                                Above discussed verb like walk, move, talk, write
                               all these are your method or we can say behavior.




                             Now it seems to me that you can understand that
             What an object is in programming language?




















No comments:

Post a Comment